Skip to content
This repository has been archived by the owner on Apr 30, 2018. It is now read-only.

Fix npm run in Windows (issue [#305](../../issue/305)) #316

Closed
wants to merge 6 commits into from

Conversation

benoror
Copy link
Member

@benoror benoror commented May 25, 2015

No description provided.

@kentcdodds
Copy link
Member

Hey @benoror, thanks for the help! A few things.

First, I don't want to have all of that commit history in the repo when I merge this. Please remove all that history and just have a single commit with your changes.

Second, I tried your changes locally and it doesn't work on my mac. I definitely want to have a solution that works everywhere. I'm thinking that a good solution would be to have a single script that sets the environment variables for us and invokes the scripts. So it would be something like:

"scripts": {
  "build:dist": "node scripts/run-script.js build:dist",
  "build:prod": "node scripts/run-script.js build:prod",
  "build": "node scripts/run-script.js build",
  "test": "node scripts/run-script.js test",
  "test:single": "node scripts/run-script.js test:single",
  "test:ci": "node scripts/run-script.js test:ci",
  "watch": "node scripts/run-script.js watch",
  "start": "node scripts/run-script.js start",
  "release": "node scripts/run-script.js release"
}

And the scripts/run-script.js would actually set process.env.NODE_ENV before invoking the script. Do you think that would work?

@benoror
Copy link
Member Author

benoror commented May 26, 2015

Sorry for the mess @kentcdodds , I'm still struggling to learn OSS collaboration procedures.

I'll try again as soon as I have an Unix environment available, BTW this situation must have been faced by many other projects, I'll investigate

_Update_: Seems that using a middleware to handle it may be the most viable option

@kentcdodds
Copy link
Member

Absolutely. Thank you for being patient and working at it. Much appreciated! 👍

@kentcdodds
Copy link
Member

Closing this PR. I like the middleware approach you mentioned. Feel free to take a stab at a PR for it if you're feeling ambitious :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants