Skip to content

Commit

Permalink
docs: explain $INIT_CWD on using scripts page (#4436)
Browse files Browse the repository at this point in the history
  • Loading branch information
wraithgar authored Feb 22, 2022
1 parent c9ff797 commit d8fa9fa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/content/using-npm/scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,11 @@ file.
preinstall or install script. If you are doing this, please consider if
there is another option. The only valid use of `install` or `preinstall`
scripts is for compilation which must be done on the target architecture.
* Scripts are run from the root of the package folder, regardless of what the
current working directory is when `npm` is invoked. If you want your
script to use different behavior based on what subdirectory you're in, you
can use the `INIT_CWD` environment variable, which holds the full path you
were in when you ran `npm run`.

### See Also

Expand Down

0 comments on commit d8fa9fa

Please sign in to comment.