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() {
bowerRequirejs({ return new Promise(function (resolve) {
config: './public/res/main.js' bowerRequirejs({
}, function() { config: './public/res/main.js'
cb(); }, resolve);
}); })
}); });
/** __________________________________________ /** __________________________________________
@ -239,39 +239,35 @@ 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) {
childProcess.exec(cmd, {cwd: process.cwd()}, function(err, stdout, stderr) { return new Promise (function (resolve, reject) {
if(!err) { childProcess.exec(cmd, {cwd: process.cwd()}, function(err, stdout, stderr) {
util.log(stdout, stderr); if (err) {
} reject(err);
cb(err); } else {
util.log(stdout, stderr);
resolve();
}
});
}); });
} }
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);
});
});
}); });
});
}); });
function releaseTask(importance) { function releaseTask(importance) {

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",