Skip to content

Commit

Permalink
fix(cli/clean): set prompt on project dir option
Browse files Browse the repository at this point in the history
This means that the prompt now gets completions for the filesystem and the titanium cli can handle
the graceful shutdown correctly
  • Loading branch information
ewanharris authored and sgtcoolguy committed Oct 26, 2020
1 parent 4cccaf0 commit f5a4391
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion cli/commands/clean.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ const appc = require('node-appc'),
path = require('path'),
sprintf = require('sprintf'),
async = require('async'),
tiappxml = require('node-titanium-sdk/lib/tiappxml');
tiappxml = require('node-titanium-sdk/lib/tiappxml'),
fields = require('fields');

exports.cliVersion = '>=3.2.1';
exports.desc = __('removes previous build directories');
Expand Down Expand Up @@ -109,6 +110,16 @@ exports.config = function (logger, config, cli) {
desc: __('the directory containing the project, otherwise the current working directory'),
default: process.env.SOURCE_ROOT ? path.join(process.env.SOURCE_ROOT, '..', '..') : '.',
order: 1,
prompt: function (callback) {
callback(fields.file({
promptLabel: __('Where is the __project directory__?'),
complete: true,
showHidden: true,
ignoreDirs: new RegExp(config.get('cli.ignoreDirs')), // eslint-disable-line security/detect-non-literal-regexp
ignoreFiles: /.*/,
validate: conf.options['project-dir'].validate
}));
},
validate: function (projectDir, callback) {
const isDefault = (projectDir == conf.options['project-dir'].default); // eslint-disable-line eqeqeq
let dir = appc.fs.resolvePath(projectDir);
Expand Down

0 comments on commit f5a4391

Please sign in to comment.