Proper way of chaining commands when using cross-env #50
Comments
Hi there, function save(namespaces) {
if (null == namespaces) {
// If you set a process.env field to null or undefined, it gets cast to the
// string 'null' or 'undefined'. Just delete instead.
delete {"NODE_ENV":"production"}.DEBUG; // <- undefined property error
} else {
{"NODE_ENV":"production"}.DEBUG = namespaces; // <- unexpected token error
}
} What is the purpose of this code? |
The reason I ask is because I'm pretty sure your problems have nothing to do with |
closing due to inactivity |
I ran into the same problem.
The two scripts |
Hi @yss14, I suggest that you just make long scripts:
Either that or you could use something like Good luck. |
It seems I just learned something new about npm scripts ;) |
This isn't an issue, just a question.
I was running into an issue when trying to use cross-env to chain several npm scripts together.
Each of these commands (aside from dev) work as expected when run individually, but when I try to chain them with dev I get errors when other tools try to access the NODE_ENV variable. e.g.
I came to the repository and read your section on known limitations and understand that I shouldn't expect that environment variables set in one side of chained commands will not necessarily be set in the other side since each link is handled as a separate spawn process, but I thought having the variable declared in each step would negate that issue.
Is there a proper way of doing this kind of command chaining or do I always need to run the scripts from separate terminal calls?
Thanks!
The text was updated successfully, but these errors were encountered: