From 853c781533d7be87c43e008b38315c560f61c347 Mon Sep 17 00:00:00 2001 From: Przemyslaw Wrzeszcz Date: Fri, 15 Feb 2019 07:31:31 +0100 Subject: [PATCH] apply PR 589 --- bin/prompt-command.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/prompt-command.js b/bin/prompt-command.js index bd38d320cfe..dd380023cdd 100644 --- a/bin/prompt-command.js +++ b/bin/prompt-command.js @@ -107,6 +107,12 @@ module.exports = function promptForInstallation(packages, ...args) { } }); } else { - require(pathForCmd).default(...args); // eslint-disable-line + let p = require(pathForCmd), c = p[packages]; + + if (typeof c !== 'function' && typeof p.default === 'function') { + c = p.default; + } + + c(...args); // eslint-disable-line } };