Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to read home directory #29

Closed
motss opened this issue Sep 25, 2017 · 3 comments
Closed

Unable to read home directory #29

motss opened this issue Sep 25, 2017 · 3 comments

Comments

@motss
Copy link

motss commented Sep 25, 2017

Tried the following command in NPM but it does not work as expected on macOS.

# package.json

{
 "scripts": {
  "start": "env-cmd ~/some-secrets.env node ./dist/server",
 }
}
# Warning message shows an incorrect path to read the ENV file.

$ npm run start

WARNING:
      Could not find or read file at:
        /Users/my-mac/test-repo/Users/my-mac/some-secrets.env
      Trying to fallback to read:
        /Users/my-mac/test-repo/.env
@toddbluhm
Copy link
Owner

I was literally just looking at the path resolving for env-cmd the other day, this is a good excuse to revisit it and fix it once and for all.

Just fyi, ~ is a bash specific character that nodejs does not resolve by default. Having said that, I use bash myself, so I want it to resolve to the home dir as well 😄

I have fixed it on this branch here: #30 . But its late here so I am heading to bed and will run a deploy tomorrow. This will be a breaking change because of how it changes the pathing schema. See the PR for details on the changes. I will update the Readme with the new pathing schemas tomorrow.

@motss
Copy link
Author

motss commented Sep 25, 2017

@toddbluhm 👍 to the fix based on excuses! This package is going to be awesome once again! 🎉

@toddbluhm
Copy link
Owner

This has been released on npm as version 7.0.0

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

No branches or pull requests

2 participants