Skip to content

Commit 790e6a0

Browse files
authored
Merge pull request #353 from pauc/refactor/commands.build
refactor(commands.build): Run 'before-build' hook before validations.
2 parents 3194e0a + cc4f941 commit 790e6a0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/commands/build.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ module.exports = Command.extend({
130130

131131
logger.info('ember-cordova: Building app');
132132

133-
return this.startValidators(project, options)
134-
.then(hook.prepare('beforeBuild', options))
133+
return hook.run('beforeBuild', options)
134+
.then(this.startValidators.bind(this, project, options))
135135
.then(function() {
136136
if (options.skipEmberBuild !== true) {
137137
return emberBuild.run();

node-tests/unit/commands/build-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ describe('Build Command', function() {
108108
.then(function() {
109109
//h-t ember-electron for the pattern
110110
expect(tasks).to.deep.equal([
111+
'hook beforeBuild',
111112
'validate-root-url',
112113
'validate-allow-navigation',
113114
'validate-platform',
114-
'hook beforeBuild',
115115
'ember-build',
116116
'cordova-build',
117117
'hook afterBuild',
@@ -127,10 +127,10 @@ describe('Build Command', function() {
127127
.then(function() {
128128
//h-t ember-electron for the pattern
129129
expect(tasks).to.deep.equal([
130+
'hook beforeBuild',
130131
'validate-root-url',
131132
'validate-allow-navigation',
132133
'validate-platform',
133-
'hook beforeBuild',
134134
'cordova-build',
135135
'hook afterBuild',
136136
'lint-index'
@@ -145,9 +145,9 @@ describe('Build Command', function() {
145145
.then(function() {
146146
//h-t ember-electron for the pattern
147147
expect(tasks).to.deep.equal([
148+
'hook beforeBuild',
148149
'validate-root-url',
149150
'validate-allow-navigation',
150-
'hook beforeBuild',
151151
'ember-build',
152152
'hook afterBuild',
153153
'lint-index'

0 commit comments

Comments
 (0)