Skip to content

Commit 2a43d44

Browse files
committed
feat: install init as global dep
Closes #564
1 parent 54c04f0 commit 2a43d44

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

bin/prompt-command.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,15 @@ module.exports = function promptForInstallation(packages, ...args) {
5858
options[0] = "add";
5959
}
6060

61+
if (packages === "init") {
62+
if (isYarn) {
63+
options.splice(1, 1); // remove '-D'
64+
options.splice(0, 0, "global");
65+
} else {
66+
options[1] = "-g";
67+
}
68+
}
69+
6170
const commandToBeRun = `${packageManager} ${options.join(" ")}`;
6271

6372
const question = `Would you like to install ${packages}? (That will run ${commandToBeRun}) (yes/NO)`;

0 commit comments

Comments
 (0)