-
Notifications
You must be signed in to change notification settings - Fork 247
Conversation
* feat(args): convert variables embedded in command args * feat(args): convert braced variables in command args * style(args): full test name on one line * refactor(args): make commandConvert definitly stateless BREAKING CHANGE: `echo $var2/$var1` would not be changed on windows, now it is. This is kind of a bug, but we're doing a major version bump to be safe.
Codecov Report
@@ Coverage Diff @@
## master #87 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 2 3 +1
Lines 34 42 +8
=====================================
+ Hits 34 42 +8
Continue to review full report at Codecov.
|
* fix(module): Add export for commonjs Add commonjs export, so it is possible to require crossEnv using `require('cross-env')` (needed to use in js script without babel) 84 * fix(module): Only export crossEnv using commonjs
* feat(spawn): add support for quoted scripts Use the shell option of spawn introduced in Node.js 4.8 (see nodejs/node#4598) to pass the command to the OS shell. Supersedes #77. * docs(readme): add gotchas Add Gotchas paragraph about passing variables to multiple scripts. * docs(readme): add required node version badge Replace the Prerequisite paragraph by a badge showing the require version of Node.js required to run cross-env. * test(spawn): add test for quoted scripts See #89 (review). BREAKING CHANGE: Changes the behavior when passed quoted scripts or special characters interpreted by the shell.
We've got the original two, but we're going to add #90 as well. Then we can get this released 👏 |
* feat: Convert list delimiters for PATH-style env variables In Windows, env variables that represent a list (such as PATH or NODE_PATH) separate their elements using a semicolon(;), but in UNIX they're separated using a colon (:). This commit adds a conversion layer, so regardless of how the delimiter is written when calling cross-env, it will be converted to the correct platform delimiter at runtime. To interpret a colon/semicolon literally instead, preced it with a backslash, like this: "cross-env VAR=semi\\;colon\\:" BREAKING CHANGE: If an env variable has : or ; in its value, it will be converted to : on UNIX systems or ; on Windows systems. To keep the old functionality, you will need to escape those characters with a backslash. #80 * chore: Add myself (DanReyLop) to the contributors list * Simplified logic. Now only : (UNIX-style) are converted to ; (Windows-style), not the other way around BREAKING CHANGE: You now must escape `:` to use it in a value of you don't want it to be swapped with `;` on Windows
Before, Windows-style env variables (%test%) would be converted to UNIX-style format ($test) in UNIX systems. That was an undocumented feature. I've removed that to simplify code a bit. Of course, UNIX to Windows format still works, as that's the intended use of cross-env. BREAKING CHANGE: %windows_style% env variables will no longer be converted to $unix_style in UNIX machines. To fix it, use always the UNIX syntax, cross-env will change the format in Windows machines as needed
* fix: Resolve value of env variables before invoking cross-spawn #90 * Refactored the main parsing loop BREAKING CHANGE: This is unlikely to break anyone, but now if you assign a variable to a variable (like `FOO=$BAR` with the value `$BAR` being assigned to `hello`, the command will be converted to `FOO=hello` whereas before it was `FOO=$BAR`).
Alright friends! All the boxes are checked. Please All that considered... Do we have any documentation updates we need to make? I feel like we should probably add docs for some things and maybe add some examples... Thoughts? |
Anyone who's tried it, please respond with 🎉 |
Alrighty, I guess it's about time we do this thing! |
And here it goes! |
This will be merged when we finish merging a few things into
next
.Once we've got those in this branch, then we'll merge and release.