Skip to content

Commit

Permalink
docs: explain $INIT_CWD on using scripts page
Browse files Browse the repository at this point in the history
  • Loading branch information
wraithgar committed Feb 18, 2022
1 parent 1b7d7ef commit 5db6595
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 run` is called. 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 5db6595

Please sign in to comment.