Skip to content

Commit

Permalink
more commands updates
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Nov 6, 2023
1 parent 2dbccf2 commit fbbbf19
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cli/src/packageinstaller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function getPackageInstallerCommand(

if (!packageName) return ["npm", "install"]

return ["npm", "install", "--save", "--no-workspaces", packageName]
return ["npm", "install", "--save", "-D", "--no-workspaces", packageName]
}

async function isPackageInstalledLocally(pkgName: string): Promise<boolean> {
Expand Down
4 changes: 3 additions & 1 deletion vscode/src/devtoolsserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -811,15 +811,17 @@ export class DeveloperToolsManager extends JDEventSource {
const yarn = await checkFileExists(cwd, "yarn.lock")
let cmd = yarn ? "yarn" : "npm"
if (command) {
args = args || []
if (command === "install") args.push("-D")
if (yarn) {
command =
{
["install"]: "add",
}[command] || command
}
cmd += " " + command
if (args?.length) cmd += " " + unique(args).join(" ")
}
if (args?.length) cmd += " " + args.join(" ")
return cmd
}

Expand Down

0 comments on commit fbbbf19

Please sign in to comment.