Skip to content

Commit

Permalink
Closes kentcdodds#153 with documentation update
Browse files Browse the repository at this point in the history
After discussion on kentcdodds#155 this seems like the better solution.
  • Loading branch information
achingbrain committed Dec 7, 2017
1 parent 50299d9 commit 76777c3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ variables declaration from the actual command execution. You can do it this way:
{
"scripts": {
"parentScript": "cross-env GREET=\"Joe\" npm run childScript",
"childScript": "echo Hello $GREET"
"childScript": "cross-env-shell \"echo Hello $GREET\""
}
}
```
Expand All @@ -95,7 +95,8 @@ Where `childScript` holds the actual command to execute and `parentScript` sets
the environment variables to use. Then instead of run the childScript you run
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.
in one line. It also means that you can use `$GREET` env var syntax even on
Windows which would usually require it to be `%GREET%`.

If you preceed a dollar sign with an odd number of backslashes the expression statement will not be replaced. Note that this means backslashes after the JSON string escaping took place. `"FOO=\\$BAR"` will not be replaced. `"FOO=\\\\$BAR"` will be replaced though.

Expand Down

1 comment on commit 76777c3

@QWp6t
Copy link

@QWp6t QWp6t commented on 76777c3 Dec 26, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you intend to submit this as a PR? Just noticed this referenced from a closed PR, but this one looks like it's correct.

Please sign in to comment.