Skip to content

Commit

Permalink
feat: install init as global dep
Browse files Browse the repository at this point in the history
Closes #564
  • Loading branch information
manu-chroma committed Oct 7, 2018
1 parent 54c04f0 commit 2a43d44
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions bin/prompt-command.js
Expand Up @@ -58,6 +58,15 @@ module.exports = function promptForInstallation(packages, ...args) {
options[0] = "add";
}

if (packages === "init") {
if (isYarn) {
options.splice(1, 1); // remove '-D'
options.splice(0, 0, "global");
} else {
options[1] = "-g";
}
}

const commandToBeRun = `${packageManager} ${options.join(" ")}`;

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

0 comments on commit 2a43d44

Please sign in to comment.