Closed anthonator closed 9 years ago
Thanks for posting. it starts local to where you run the command from. if you are run this command: cd ~/project; app test/*
and app
uses rc
then it will see ~/project/.apprc
but not ~project/test/.apprc
basically, it's because in node you can see your own filename and directory (__dirname
and __filename
) and the processes current directory process.cwd()
The process's current working directory is readily acessable in unix, but not always the "__filename" (try it in bash!, especially once symlinks come into play!)
if you want to put default config relative to your actual code, you should put it inside your code.
normally I have a config.js
file that sets up rc with defaults and can be required by other parts of by application. here is an example: https://github.com/ssbc/scuttlebot/blob/master/config.js
I can't seem to get
rc
to behave like I assumed it would. I want to test loading my config by putting a.apprc
file in mytest
directory. However,rc
doesn't ever look there. I assumed it would look in the directory where the code was executing.I have a project with the following directory structure:
loadConfig.js
testLoadConfig.js
I figure this is either designed this way intentionally or is a technical limitation but it's causing some heartburn so I thought I'd bring it up.