diff --git a/gulpfile.babel.js b/gulpfile.babel.js index e8de1b8..9f18d2b 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -4,8 +4,8 @@ import sourcemaps from 'gulp-sourcemaps'; import webpack from 'webpack-stream'; import babel from 'gulp-babel'; import runSequence from 'run-sequence'; - import path from 'path'; +import childProcess from 'child_process'; const PATHS = setUpPaths(); @@ -55,6 +55,15 @@ gulp.task('watch', ['build'], () => { .on('error', handleError); }); +gulp.task('publish', done => { + childProcess.spawn('npm', ['publish'], {stdio: 'inherit'}) + .on('close', done); +}); + +gulp.task('release', callback => { + return runSequence('build', 'publish', callback); +}); + function setUpPaths() { const paths = { WEBPACK_CONFIG: './webpack.config.js', diff --git a/package.json b/package.json index f7f1b72..c5c5d99 100644 --- a/package.json +++ b/package.json @@ -13,11 +13,12 @@ "scripts": { "dev-up": "npm install && (cd app && npm install)", "test": "echo \"Error: no test specified\" && exit 1", + "clean": "gulp clean", "build": "gulp build", "watch": "while true ; do gulp watch ; done", "package-placeholder": "npm run build && node lib/cli.js http://www.medium.com ~/Desktop --overwrite && open ~/Desktop/Medium-darwin-x64/Medium.app", "start-placeholder": "npm run build && electron app", - "clean": "gulp clean" + "release": "gulp release" }, "bin": { "nativefier": "lib/cli.js"