From 75450c139dff0f6459488bc9acd7525eeef4e368 Mon Sep 17 00:00:00 2001 From: Hugo Wood Date: Wed, 15 Mar 2017 10:26:32 +0100 Subject: [PATCH] docs(readme): add gotchas Add Gotchas paragraph about passing variables to multiple scripts. --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index d2fedad..c1b5374 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,19 @@ the parent. This is quite useful for launching the same command with different env variables or when the environment variables are too long to have everything in one line. +## Gotchas + +If you want to have the environment variable apply to several commands in series +then you will need to wrap those in quotes in your script. For example: + +```json +{ + "scripts": { + "greet": "cross-env GREETING=Hi NAME=Joe \"echo $GREETING && echo $NAME\"" + } +} +``` + ## Inspiration I originally created this to solve a problem I was having with my npm scripts in