From 2dafaff7d1ce202b0cabb87d30a7b3c61466e147 Mon Sep 17 00:00:00 2001 From: Benjamin Orozco Date: Wed, 9 Dec 2015 11:02:28 -0600 Subject: [PATCH] Update README.md Fixes https://github.com/benoror/better-npm-run/issues/25 --- README.md | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 046c950..88cbfd6 100644 --- a/README.md +++ b/README.md @@ -70,9 +70,31 @@ To this: } ``` -Also if you have .env file in your project root it will be loaded on every command +# .env File + +If you have an `.env` file in your project root it will be loaded on every command ``` NODE_PATH=./:./lib PORT=5000 -``` \ No newline at end of file +``` + +# Shell scripts + +Currently, using [bash variables](http://tldp.org/LDP/abs/html/internalvariables.html) (PWD, USER, etc.) is not possible: + +``` JSON + "command": "forever start -l ${PWD}/logs/forever.log -o ${PWD}/logs/out.log -e ${PWD}/logs/errors.log -a index.js", +``` + +In order to use them, you can create an script file (`.sh`) instead: + +`forever.sh`: +``` bash +forever start -l ${PWD}/logs/forever.log -o ${PWD}/logs/out.log -e ${PWD}/logs/errors.log -a index.js +``` + +`package.json`: +``` javascript + "command": "./forever.sh" +```