mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Initial commit
This commit is contained in:
parent
dd51a48435
commit
5eaf6ac3b3
51 changed files with 10087 additions and 1 deletions
26
src/packagemanager/npm/utils/npmCommands.js
Normal file
26
src/packagemanager/npm/utils/npmCommands.js
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import { deref } from "./cmd-list.js";
|
||||
|
||||
export function getNpmCommandForArgs(args) {
|
||||
if (args.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const argCommand = deref(args[0]);
|
||||
if (!argCommand) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return argCommand;
|
||||
}
|
||||
|
||||
export function hasDryRunArg(args) {
|
||||
return args.some((arg) => arg === "--dry-run");
|
||||
}
|
||||
|
||||
export const npmInstallCommand = "install";
|
||||
export const npmCiCommand = "ci";
|
||||
export const npmInstallTestCommand = "install-test";
|
||||
export const npmInstallCiTestCommand = "install-ci-test";
|
||||
export const npmUpdateCommand = "update";
|
||||
export const npmAuditCommand = "audit";
|
||||
export const npmExecCommand = "exec";
|
||||
Loading…
Add table
Add a link
Reference in a new issue