Skip to content

Commit

Permalink
cl and engine stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
pirog committed Sep 28, 2023
1 parent 9292bdd commit 0543b01
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## v3.20.1 - [September 28, 2023](https://github.com/lando/cli/releases/tag/3.20.1)

### Fixes

* Fixed bug causing `Invalid host defined options` when using `lando` renderer in `packaged` mode [#216](https://github.com/lando/cli/issues/216)

## v3.20.0 - [September 22, 2023](https://github.com/lando/cli/releases/tag/3.20.0)

### New Features
Expand Down
18 changes: 18 additions & 0 deletions lib/formatters.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,23 @@ exports.handleInteractive = (inquiry, argv, command, lando) => lando.Promise.try
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 === 'engine') {
// get id
const getId = command => {
if (typeof command === 'string') return command.split(' ')[0];
return command;
};
const tooling = _(_.get(argv, '_app.tooling', {}))
.map((tooling, command) => _.merge({}, tooling, {command}))
.concat(lando.tasks)
.map(command => _.merge({}, command, {id: command.id || getId(command.command)}))
.value();

inquiry = exports.getInteractive(_.find(tooling, {id: command}).options, argv);
return inquirer.prompt(_.sortBy(inquiry, 'weight'));
}

// 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
Expand All @@ -103,6 +120,7 @@ exports.handleInteractive = (inquiry, argv, command, lando) => lando.Promise.try
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);
Expand Down

0 comments on commit 0543b01

Please sign in to comment.