Skip to content

Commit

Permalink
fix(CLI): Ensure to recognize interactive CLI command properly
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Apr 20, 2021
1 parent f430224 commit 40fddcc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/plugins/interactiveCli/index.js
Expand Up @@ -19,6 +19,14 @@ module.exports = class InteractiveCli {
};

this.hooks = {
'initialize': () => {
if (!this.serverless.interactiveCli) return;
const { processedInput } = this.serverless;
// After `sls.init()`, if any external plugins are loaded, commands are re-resolved
// (in `scripts/serverless.js`) and that reverts patch applied in asyncInit() below.
// Bring it back
if (!processedInput.commands.length) processedInput.commands.push('interactiveCli');
},
'interactiveCli:initializeService': () => {
if (!initializeService.check(serverless)) return null;
process.stdout.write('\n');
Expand Down

0 comments on commit 40fddcc

Please sign in to comment.