Skip to content

Commit 21f97e3

Browse files
committed
Merge pull request #1793 from angular-fullstack/fix/heroku-openshift-gulp
Fix/heroku openshift gulp
2 parents b5552c9 + 2f1a229 commit 21f97e3

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

heroku/index.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,13 @@ Generator.prototype.copyProcfile = function copyProcfile() {
112112
});
113113
};
114114

115-
Generator.prototype.gruntBuild = function gruntBuild() {
115+
Generator.prototype.build = function build() {
116116
if(this.abort) return;
117117
var done = this.async();
118+
var buildCommand = this.filters.grunt ? 'grunt build' : 'gulp build';
118119

119120
this.log(chalk.bold('\nBuilding dist folder, please wait...'));
120-
var child = exec('grunt build', function (err, stdout) {
121+
var child = exec(buildCommand, function (err, stdout) {
121122
done();
122123
}.bind(this));
123124
child.stdout.on('data', function(data) {
@@ -187,8 +188,12 @@ Generator.prototype.gitForcePush = function gitForcePush() {
187188
this.log(chalk.green('\nYou may need to address the issues mentioned above and restart the server for the app to work correctly.'));
188189
}
189190

190-
this.log(chalk.yellow('After app modification run\n\t' + chalk.bold('grunt build') +
191-
'\nThen deploy with\n\t' + chalk.bold('grunt buildcontrol:heroku')));
191+
this.log(chalk.yellow(
192+
'After app modification run\n\t' +
193+
chalk.bold(this.filters.grunt ? 'grunt build' : 'gulp build') +
194+
'\nThen deploy with\n\t' +
195+
chalk.bold(this.filters.grunt ? 'grunt buildcontrol:heroku' : 'gulp buildcontrol:heroku')
196+
));
192197
}
193198
done();
194199
}.bind(this));

openshift/index.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,13 @@ Generator.prototype.enableOpenShiftHotDeploy = function enableOpenshiftHotDeploy
193193
});
194194
};
195195

196-
Generator.prototype.gruntBuild = function gruntBuild() {
196+
Generator.prototype.build = function build() {
197197
if(this.abort || !this.openshift_remote_exists ) return;
198198
var done = this.async();
199+
var buildCommand = this.filters.grunt ? 'grunt build' : 'gulp build';
199200

200201
this.log(chalk.bold('\nBuilding dist folder, please wait...'));
201-
var child = exec('grunt build', function (err, stdout) {
202+
var child = exec(buildCommand, function (err, stdout) {
202203
if (err) {
203204
this.log.error(err);
204205
}
@@ -294,7 +295,12 @@ Generator.prototype.restartApp = function restartApp() {
294295
this.log(chalk.green('\nYou may need to address the issues mentioned above and restart the server for the app to work correctly \n\t' +
295296
'rhc app-restart -a ' + this.deployedName));
296297
}
297-
this.log(chalk.yellow('After app modification run\n\t' + chalk.bold('grunt build') +
298-
'\nThen deploy with\n\t' + chalk.bold('grunt buildcontrol:openshift')));
298+
299+
this.log(chalk.yellow(
300+
'After app modification run\n\t' +
301+
chalk.bold(this.filters.grunt ? 'grunt build' : 'gulp build') +
302+
'\nThen deploy with\n\t' +
303+
chalk.bold(this.filters.grunt ? 'grunt buildcontrol:openshift' : 'gulp buildcontrol:openshift')
304+
));
299305
}.bind(this));
300306
};

0 commit comments

Comments
 (0)