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

View File

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