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

Ability to read config.yml from the app root directory path #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fuss86
Copy link

@fuss86 fuss86 commented Sep 18, 2018

This PR allows to read config.yml from the application root path as a fallback location.

Example:
node /path/to/main/script.js will read /path/to/main/config.yml if the config-yml module was located in /path/to/main/node_modules/config-yml

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.8%) to 93.548% when pulling b58d04a on fuss86:app_root_config_yml into 0b1a23e on Nordstrom:master.

@andyday
Copy link
Contributor

andyday commented Sep 18, 2018

It already loads config.yml from the app root. If its not working for you can you provide more details of your usage?

@fuss86
Copy link
Author

fuss86 commented Sep 18, 2018

If you run the node process from outside of the app root (for example from the / directory) then fs.existsSync('config.yml') will try to lookup config.yml from the working directory (which may not be the app root directory) (e.g. /config.yml, following the example).

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

Successfully merging this pull request may close these issues.

4 participants