8000 docs: add --if-present to run-script docs (#20279) · npm/npm@ad7a596 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Aug 11, 2022. It is now read-only.

Commit ad7a596

Browse files
aleclarsonzkat
authored andcommitted
docs: add --if-present to run-script docs (#20279)
PR-URL: #20279 Credit: @aleclarson Reviewed-By: @iarna
1 parent a1c77d6 commit ad7a596

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

doc/cli/npm-run-script.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ you will be given a warning to run `npm install`, just in case you've forgotten.
6868

6969
You can use the `--silent` flag to prevent showing `npm ERR!` output on error.
7070

71+
You can use the `--if-present` flag to avoid exiting with a non-zero exit code
72+
when the script is undefined. This lets you run potentially undefined scripts
73+
without breaking the execution chain.
74+
7175
## SEE ALSO
7276

7377
* npm-scripts(7)

0 commit comments

Comments
 (0)
0