We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 649048c commit 151363fCopy full SHA for 151363f
core/command/index.js
@@ -77,7 +77,14 @@ class Command {
77
});
78
79
// passed via yargs context in tests, never actual CLI
80
- runner = runner.then(argv.onResolved, argv.onRejected);
+ /* istanbul ignore else */
81
+ if (argv.onResolved || argv.onRejected) {
82
+ runner = runner.then(argv.onResolved, argv.onRejected);
83
+
84
+ // when nested, never resolve inner with outer callbacks
85
+ delete argv.onResolved; // eslint-disable-line no-param-reassign
86
+ delete argv.onRejected; // eslint-disable-line no-param-reassign
87
+ }
88
89
// proxy "Promise" methods to "private" instance
90
this.then = (onResolved, onRejected) => runner.then(onResolved, onRejected);
0 commit comments