rushstack icon indicating copy to clipboard operation
rushstack copied to clipboard

[rush] Add `--ignore-scripts` option for rush update and install

Open F3n67u opened this issue 3 years ago • 1 comments

Summary

Add --ignore-scripts option for rush update and rush install.

when specify --ignore-scripts , do not execute any scripts defined in the project package.json and its dependencies.

Details

npm/pnpm/yarn both support --ignore-scripts.

  • npm: https://docs.npmjs.com/cli/v7/commands/npm-install#ignore-scripts

  • pnpm: https://pnpm.io/cli/install#--ignore-scripts

  • yarn: https://classic.yarnpkg.com/en/docs/cli/install/#toc-yarn-install-ignore-scripts

How it was tested

Test with microsoft/rush-example repo.

  1. add core-js to tools/my-toolchain's dependency, because core-js has a postinstall scripts.
  2. invoke rush -d install -p and rush -d update -p with --ignore-scripts options, verify core-js's postinstall scripts is not run.
  3. invoke rush -d install -p and rush -d update -p without --ignore-scripts options, verify core-js's postinstall scripts is run.
  4. change package manager to yarn, repeat step 2 and step 3.
  5. change package manager to npm, repeat step 2 and step 3.

F3n67u avatar Oct 23 '21 06:10 F3n67u

Note: PR #3337 has renamed our GitHub master branch to main. This should not affect your pull request, but we recommend to redo your git clone to avoid confusion with the old branch name.

iclanton avatar Apr 09 '22 02:04 iclanton