Update yarn and npm shells

Mention an additional way to run scripts as suggested in #224.
This commit is contained in:
Andrea Cardaci 2021-06-22 22:11:05 +02:00
parent 390c49394a
commit fd476e08c2
2 changed files with 6 additions and 3 deletions

View File

@ -2,12 +2,14 @@
functions: functions:
shell: shell:
- code: npm exec /bin/sh - code: npm exec /bin/sh
- code: | - description: Additionally, arbitrary script names can be used in place of `preinstall` and triggered by name with, e.g., `npm -C $TF run preinstall`.
code: |
TF=$(mktemp -d) TF=$(mktemp -d)
echo '{"scripts": {"preinstall": "/bin/sh"}}' > $TF/package.json echo '{"scripts": {"preinstall": "/bin/sh"}}' > $TF/package.json
npm -C $TF i npm -C $TF i
sudo: sudo:
- code: | - description: Additionally, arbitrary script names can be used in place of `preinstall` and triggered by name with, e.g., `npm -C $TF run preinstall`.
code: |
TF=$(mktemp -d) TF=$(mktemp -d)
echo '{"scripts": {"preinstall": "/bin/sh"}}' > $TF/package.json echo '{"scripts": {"preinstall": "/bin/sh"}}' > $TF/package.json
sudo npm -C $TF --unsafe-perm i sudo npm -C $TF --unsafe-perm i

View File

@ -2,7 +2,8 @@
functions: functions:
shell: shell:
- code: yarn exec /bin/sh - code: yarn exec /bin/sh
- code: | - description: Additionally, arbitrary script names can be used in place of `preinstall` and triggered by name with, e.g., `yarn --cwd $TF run preinstall`.
code: |
TF=$(mktemp -d) TF=$(mktemp -d)
echo '{"scripts": {"preinstall": "/bin/sh"}}' > $TF/package.json echo '{"scripts": {"preinstall": "/bin/sh"}}' > $TF/package.json
yarn --cwd $TF install yarn --cwd $TF install