@@ -94,6 +94,23 @@ exports.handleInteractive = (inquiry, argv, command, lando) => lando.Promise.try
94
94
else {
95
95
const inquirer = require ( 'inquirer' ) ;
96
96
inquirer . registerPrompt ( 'autocomplete' , require ( 'inquirer-autocomplete-prompt' ) ) ;
97
+ // Try to rebuild the inquiry if this is app level bootstrap and we have an app
98
+ if ( ! _ . isEmpty ( argv . _app ) && lando . _bootstrap === 'engine' ) {
99
+ // get id
100
+ const getId = command => {
101
+ if ( typeof command === 'string' ) return command . split ( ' ' ) [ 0 ] ;
102
+ return command ;
103
+ } ;
104
+ const tooling = _ ( _ . get ( argv , '_app.tooling' , { } ) )
105
+ . map ( ( tooling , command ) => _ . merge ( { } , tooling , { command} ) )
106
+ . concat ( lando . tasks )
107
+ . map ( command => _ . merge ( { } , command , { id : command . id || getId ( command . command ) } ) )
108
+ . value ( ) ;
109
+
110
+ inquiry = exports . getInteractive ( _ . find ( tooling , { id : command } ) . options , argv ) ;
111
+ return inquirer . prompt ( _ . sortBy ( inquiry , 'weight' ) ) ;
112
+ }
113
+
97
114
// Try to rebuild the inquiry if this is app level bootstrap and we have an app
98
115
if ( ! _ . isEmpty ( argv . _app ) && lando . _bootstrap === 'app' ) {
99
116
// NOTE: We need to clone deep here otherwise any apps with interactive options get 2x all their events
@@ -103,6 +120,7 @@ exports.handleInteractive = (inquiry, argv, command, lando) => lando.Promise.try
103
120
inquiry = exports . getInteractive ( _ . find ( app . tasks . concat ( lando . tasks ) , { command : command } ) . options , argv ) ;
104
121
return inquirer . prompt ( _ . sortBy ( inquiry , 'weight' ) ) ;
105
122
} ) ;
123
+
106
124
// Otherwise just run
107
125
} else {
108
126
inquiry = exports . getInteractive ( _ . find ( lando . tasks , { command : command } ) . options , argv ) ;
0 commit comments