Open soletan opened 6 years ago
Have you tried returning the promise from action
instead of relying on the callback?
Using callback is actually required due to #171 as callback isn't to be used in every case. In addition the Promise.resolve()
is used here for this.prompt()
is returning undefined
w/o the fix resulting in a ReferenceError
.
Using code provided in https://github.com/dthree/vorpal/issues/171#issuecomment-298230095 I can't use
this.prompt()
to ask user additional things. Obviously this is due to ui.js requiring to have someparent
which is missing then.According to the template given in comment linked before, when I write an action like this:
the prompt is showing up when running in REPL mode, but it's omitted when running script with
some-cmd
selected on CLI like this:I was able to fix this issue by explicitly assigning current command's parent to the UI prior to prompting but I bet this isn't safe due to monkey-patching some more static part of Vorpal from a more instance-like part of code.