rushstack
rushstack copied to clipboard
[rush] Add `--ignore-scripts` option for rush update and install
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.
- add
core-js
totools/my-toolchain
's dependency, becausecore-js
has apostinstall
scripts. - invoke
rush -d install -p
andrush -d update -p
with--ignore-scripts
options, verifycore-js
's postinstall scripts is not run. - invoke
rush -d install -p
andrush -d update -p
without--ignore-scripts
options, verifycore-js
's postinstall scripts is run. - change package manager to
yarn
, repeat step 2 and step 3. - change package manager to
npm
, repeat step 2 and step 3.
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.