const listProcesses = async (processes, flags) => { inquirer.registerPrompt('autocomplete', require('inquirer-autocomplete-prompt')); const answer = await inquirer.prompt([{ name: 'processes', message: 'Running processes:', type: 'autocomplete', pageSize: 10, source: async (answers, input) => filterProcesses(input, processes, flags) }]); try { await fkill(answer.processes); } catch (_) { handleFkillError(answer.processes); } }
lando.Promise.try(() => { if (_.isEmpty(inquiry)) return {}; else { const inquirer = require('inquirer'); inquirer.registerPrompt('autocomplete', require('inquirer-autocomplete-prompt')); // Try to rebuild the inquiry if this is app level bootstrap and we have an app if (!_.isEmpty(argv._app) && lando._bootstrap === 'app') { // NOTE: We need to clone deep here otherwise any apps with interactive options get 2x all their events // NOTE: Not exactly clear on why app here gets conflated with the app returned from lando.getApp const app = _.cloneDeep(lando.getApp(argv._app.root)); return app.init().then(() => { inquiry = exports.getInteractive(_.find(app.tasks.concat(lando.tasks), {command: command}).options, argv); return inquirer.prompt(_.sortBy(inquiry, 'weight')); }); // Otherwise just run } else { inquiry = exports.getInteractive(_.find(lando.tasks, {command: command}).options, argv); return inquirer.prompt(_.sortBy(inquiry, 'weight')); } } })