From cd2d4b22e231342e8a5c739649945b6cc6f8eab3 Mon Sep 17 00:00:00 2001 From: Daniel Ruf Date: Sat, 23 Feb 2019 17:48:06 +0100 Subject: [PATCH] refactor: replace inquirer with the native readline methods --- gulp/tasks/deploy.js | 25 ++++++++++++++++--------- package.json | 1 - 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/gulp/tasks/deploy.js b/gulp/tasks/deploy.js index 30682d361..604da40f5 100644 --- a/gulp/tasks/deploy.js +++ b/gulp/tasks/deploy.js @@ -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'); @@ -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 diff --git a/package.json b/package.json index efe202804..de1325144 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,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", -- 2.47.2