support force install
This commit is contained in:
Родитель
52848a8783
Коммит
c3a2b46c9b
|
@ -20,8 +20,12 @@ export async function createPackageJson(rootPath: string, deps: Set<string>): Pr
|
|||
}
|
||||
|
||||
export async function npmCIDependencies(workingDir: string): Promise<void> {
|
||||
const args = ["ci"];
|
||||
if (process.env['TSPCLIENT_UNSAFE_FORCE'] === "force") {
|
||||
args.push("--force");
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
const npm = spawn("npm", ["ci"], {
|
||||
const npm = spawn("npm", args, {
|
||||
cwd: workingDir,
|
||||
stdio: "inherit",
|
||||
shell: true,
|
||||
|
@ -40,8 +44,12 @@ export async function npmCIDependencies(workingDir: string): Promise<void> {
|
|||
}
|
||||
|
||||
export async function npmInstallDependencies(workingDir: string): Promise<void> {
|
||||
const args = ["install"];
|
||||
if (process.env['TSPCLIENT_UNSAFE_FORCE'] === "force") {
|
||||
args.push("--force");
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
const npm = spawn("npm", ["install", "--no-lock-file"], {
|
||||
const npm = spawn("npm", args, {
|
||||
cwd: workingDir,
|
||||
stdio: "inherit",
|
||||
shell: true,
|
||||
|
|
Загрузка…
Ссылка в новой задаче