ericclemmons / if-env

Simplify npm scripts with `if-env ... && npm run this || npm run that`
MIT License
97 stars 14 forks source link

if-env NODE_ENV=production && npm run start:prod || npm start:dev #6

Closed syavorsky closed 6 years ago

syavorsky commented 8 years ago

This command may play really bad joke with you, I learned it a hard way

if-env NODE_ENV=production && npm run start:prod || npm start:dev

if your app dies on unhandled exception then npm run start:prod returns no-zero code, then this expression proceeds to the npm start:dev and restarts your app in dev mode

ericclemmons commented 8 years ago

I had the same thing happen too :(

Our company has switched to per-env to avoid a lot of the && || bullcrap...

https://github.com/ericclemmons/per-env/

kentcdodds commented 6 years ago

Perhaps the README should be updated to reveal this issue?

kentcdodds commented 6 years ago

Correction. The README was updated, but a new version hasn't been published since so the README on npm doesn't show the update.

ericclemmons commented 6 years ago

Oh, thanks for letting me know! I'll push a new version. Because of bash-level fun like this, I've mostly switched to using per-env:

https://github.com/ericclemmons/per-env

Between p-s and per-env, looks like package.json could use some help ;)

ericclemmons commented 6 years ago

Promise I'm going to re-release. Been busy with https://twitter.com/ericclemmons/status/951552612754698245

ericclemmons commented 6 years ago

Ok, v1.0.4 is on NPM with what I assume to be the latest README.

It seems every project I've ever had deploys & publishes differently, so here's hoping it worked. :shrug: