Fixed gulp build

This commit is contained in:
Benoit Schweblin 2017-09-29 20:16:04 +01:00
parent 608ffd3229
commit 85acdfd8ec
2 changed files with 31 additions and 35 deletions

View File

@ -97,12 +97,12 @@ gulp.task('requirejs', [
.pipe(gulp.dest('./public/res-min/')); .pipe(gulp.dest('./public/res-min/'));
}); });
gulp.task('bower-requirejs', function(cb) { gulp.task('bower-requirejs', function() {
return new Promise(function (resolve) {
bowerRequirejs({ bowerRequirejs({
config: './public/res/main.js' config: './public/res/main.js'
}, function() { }, resolve);
cb(); })
});
}); });
/** __________________________________________ /** __________________________________________
@ -239,38 +239,34 @@ gulp.task('bump-patch', bumpTask('patch'));
gulp.task('bump-minor', bumpTask('minor')); gulp.task('bump-minor', bumpTask('minor'));
gulp.task('bump-major', bumpTask('major')); gulp.task('bump-major', bumpTask('major'));
function exec(cmd, cb) { function exec(cmd) {
return new Promise (function (resolve, reject) {
childProcess.exec(cmd, {cwd: process.cwd()}, function(err, stdout, stderr) { childProcess.exec(cmd, {cwd: process.cwd()}, function(err, stdout, stderr) {
if(!err) { if (err) {
reject(err);
} else {
util.log(stdout, stderr); util.log(stdout, stderr);
resolve();
} }
cb(err); });
}); });
} }
gulp.task('git-tag', function(cb) { gulp.task('git-tag', function() {
var tag = 'v' + getVersion(); var tag = 'v' + getVersion();
util.log('Tagging as: ' + util.colors.cyan(tag)); util.log('Tagging as: ' + util.colors.cyan(tag));
exec('git add ./public/res-min', function(err) { return exec('git add ./public/res-min')
if(err) { .then(function () {
return cb(err); return exec('git commit -a -m "Prepare release"');
} })
exec('git commit -a -m "Prepare release"', function(err) { .then(function () {
if(err) { return exec('git tag -a ' + tag + ' -m "Version ' + getVersion() + '"');
return cb(err); })
} .then(function () {
exec('git tag -a ' + tag + ' -m "Version ' + getVersion() + '"', function(err) { return exec('npm publish');
if(err) { })
return cb(err); .then(function () {
} return exec('git push origin master --tags');
exec('npm publish', function(err) {
if(err) {
return cb(err);
}
exec('git push origin master --tags', cb);
});
});
});
}); });
}); });

View File

@ -19,8 +19,8 @@
"ssh2": "^0.3.5" "ssh2": "^0.3.5"
}, },
"devDependencies": { "devDependencies": {
"gulp": "^3.8.7", "gulp": "^3.9.1",
"gulp-requirejs": "^0.1.3", "gulp-requirejs": "^1.0.0",
"gulp-jshint": "^1.8.4", "gulp-jshint": "^1.8.4",
"gulp-uglify": "^1.1.0", "gulp-uglify": "^1.1.0",
"gulp-less": "^1.3.5", "gulp-less": "^1.3.5",