Skip to content

Commit

Permalink
Merge pull request foundation#11695 from DanielRuf/refactor/replace-i…
Browse files Browse the repository at this point in the history
…nquirer-with-readline

refactor: replace inquirer with the native readline methods
  • Loading branch information
kball authored Jul 26, 2019
2 parents fa7562b + cd2d4b2 commit 0d4d90f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
25 changes: 16 additions & 9 deletions gulp/tasks/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ var confirm = require('gulp-prompt').confirm;
var rsync = require('gulp-rsync');
var replace = require('gulp-replace');
var octophant = require('octophant');
var inquirer = require('inquirer');
var readline = require('readline');
var { green, bold } = require('kleur');
var exec = require('child_process').execSync;
var plumber = require('gulp-plumber');
var sourcemaps = require('gulp-sourcemaps');
Expand All @@ -25,15 +26,21 @@ gulp.task('deploy:dist', gulp.series('sass:foundation', 'javascript:foundation',
gulp.task('deploy:plugins', gulp.series('deploy:plugins:sources', 'deploy:plugins:sourcemaps'));

gulp.task('deploy:prompt', function(cb) {
inquirer.prompt([{
type: 'input',
name: 'version',
message: 'What version are we moving to? (Current version is ' + CURRENT_VERSION + ')'
}])
.then(function(res) {
NEXT_VERSION = res.version;
cb();
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});

rl.question(
green('?') + ' ' + bold('What version are we moving to? (Current version is ' + CURRENT_VERSION + ') '),
(version) => {
NEXT_VERSION = version
? version
: CURRENT_VERSION;
rl.close();
cb();
}
);
});

// Bumps the version number in any file that has one
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
"gulp-uglify": "^3.0.0",
"gulp-zip": "^4.1.0",
"husky": "^1.3.1",
"inquirer": "^6.2.1",
"is-empty-object": "^1.1.1",
"jquery": "^3.3.1",
"js-yaml": "^3.12.1",
Expand Down

0 comments on commit 0d4d90f

Please sign in to comment.