Skip to content

Commit

Permalink
fix(lerna): ignore scripts (#6581)
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Jun 25, 2020
1 parent 013c636 commit ceb7c22
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 5 additions & 5 deletions lib/manager/npm/post-update/__snapshots__/lerna.spec.ts.snap
Expand Up @@ -59,7 +59,7 @@ Array [
},
},
Object {
"cmd": "lerna bootstrap --no-ci -- --ignore-scripts --no-audit --package-lock-only",
"cmd": "lerna bootstrap --no-ci --ignore-scripts -- --ignore-scripts --no-audit --package-lock-only",
"options": Object {
"cwd": "some-dir",
"encoding": "utf-8",
Expand Down Expand Up @@ -98,7 +98,7 @@ Array [
},
},
Object {
"cmd": "lerna bootstrap --no-ci -- --ignore-scripts --no-audit --package-lock-only",
"cmd": "lerna bootstrap --no-ci --ignore-scripts -- --ignore-scripts --no-audit --package-lock-only",
"options": Object {
"cwd": "some-dir",
"encoding": "utf-8",
Expand Down Expand Up @@ -137,7 +137,7 @@ Array [
},
},
Object {
"cmd": "lerna bootstrap --no-ci -- --ignore-scripts --ignore-engines --ignore-platform",
"cmd": "lerna bootstrap --no-ci --ignore-scripts -- --ignore-scripts --ignore-engines --ignore-platform",
"options": Object {
"cwd": "some-dir",
"encoding": "utf-8",
Expand Down Expand Up @@ -176,7 +176,7 @@ Array [
},
},
Object {
"cmd": "lerna bootstrap --no-ci -- --ignore-scripts --no-audit --package-lock-only",
"cmd": "lerna bootstrap --no-ci --ignore-scripts -- --ignore-scripts --no-audit --package-lock-only",
"options": Object {
"cwd": "some-dir",
"encoding": "utf-8",
Expand Down Expand Up @@ -215,7 +215,7 @@ Array [
},
},
Object {
"cmd": "lerna bootstrap --no-ci -- --ignore-scripts --no-audit",
"cmd": "lerna bootstrap --no-ci --ignore-scripts -- --ignore-scripts --no-audit",
"options": Object {
"cwd": "some-dir",
"encoding": "utf-8",
Expand Down
5 changes: 4 additions & 1 deletion lib/manager/npm/post-update/lerna.ts
Expand Up @@ -55,9 +55,12 @@ export async function generateLockFiles(
logger.warn({ lernaClient }, 'Unknown lernaClient');
return { error: false };
}
let lernaCommand = `lerna bootstrap --no-ci --ignore-scripts -- `;
if (global.trustLevel === 'high' && config.ignoreScripts !== false) {
cmdOptions = cmdOptions.replace('--ignore-scripts ', '');
lernaCommand = lernaCommand.replace('--ignore-scripts ', '');
}
lernaCommand += cmdOptions;
const tagConstraint = await getNodeConstraint(config);
const execOptions: ExecOptions = {
cwd,
Expand Down Expand Up @@ -93,7 +96,7 @@ export async function generateLockFiles(
}
logger.debug('Using lerna version ' + lernaVersion);
preCommands.push(`npm i -g lerna@${quote(lernaVersion)}`);
cmd.push(`lerna bootstrap --no-ci -- ${cmdOptions}`);
cmd.push(lernaCommand);
await exec(cmd, execOptions);
} catch (err) /* istanbul ignore next */ {
logger.debug(
Expand Down

0 comments on commit ceb7c22

Please sign in to comment.