From 69f3fec1ed040312863718eaad31972d3de99656 Mon Sep 17 00:00:00 2001 From: Duzy Chan Date: Sat, 15 Sep 2018 19:28:28 +0800 Subject: [PATCH] An attempt to fix #572 the strange things in this fix is about packages -- if it's not indicating the sub-command or a list of commands? --- bin/prompt-command.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/prompt-command.js b/bin/prompt-command.js index 71f697c9360..f0ed5fe9d0a 100644 --- a/bin/prompt-command.js +++ b/bin/prompt-command.js @@ -105,6 +105,10 @@ 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 } };