{"action":"created","issue":{"url":"https://api.github.com/repos/dominictarr/rc/issues/53","labels_url":"https://api.github.com/repos/dominictarr/rc/issues/53/labels{/name}","comments_url":"https://api.github.com/repos/dominictarr/rc/issues/53/comments","events_url":"https://api.github.com/repos/dominictarr/rc/issues/53/events","html_url":"https://github.com/dominictarr/rc/pull/53","id":88745919,"number":53,"title":"Start search for rc file from running script and not from cwd","user":{"login":"guyellis","id":2047725,"avatar_url":"https://avatars.githubusercontent.com/u/2047725?v=3","gravatar_id":"","url":"https://api.github.com/users/guyellis","html_url":"https://github.com/guyellis","followers_url":"https://api.github.com/users/guyellis/followers","following_url":"https://api.github.com/users/guyellis/following{/other_user}","gists_url":"https://api.github.com/users/guyellis/gists{/gist_id}","starred_url":"https://api.github.com/users/guyellis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guyellis/subscriptions","organizations_url":"https://api.github.com/users/guyellis/orgs","repos_url":"https://api.github.com/users/guyellis/repos","events_url":"https://api.github.com/users/guyellis/events{/privacy}","received_events_url":"https://api.github.com/users/guyellis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-06-16T14:38:10Z","updated_at":"2015-06-16T18:29:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dominictarr/rc/pulls/53","html_url":"https://github.com/dominictarr/rc/pull/53","diff_url":"https://github.com/dominictarr/rc/pull/53.diff","patch_url":"https://github.com/dominictarr/rc/pull/53.patch"},"body":"I have a situation where the node application is being started from the root of the directory structure. \r\n\r\nApp location:\r\n`/home/guy/myapp/index.js`\r\nStart location:\r\n`/`\r\n\r\ni.e. my app is started by using: `node home/guy/myapp/index.js`\r\n\r\nThis makes the `process.cwd()` start searching from the root so it never finds my app's rc file. If we change it to `__dirname` then it will start searching from (in my example) `/home/guy/myapp/node_modules/rc/lib/`. This would solve the problem.\r\n\r\nImplication for other users of rc that are starting from the normal home directory of the app: So long as they didn't have an rc file for their application in `node_modules`, `node_modules/rc`, or `node_modules/rc/lib` then it will behave as normal. I can't think of a use case where they would have their app's rc file in any of those locations..."},"comment":{"url":"https://api.github.com/repos/dominictarr/rc/issues/comments/112522040","html_url":"https://github.com/dominictarr/rc/pull/53#issuecomment-112522040","issue_url":"https://api.github.com/repos/dominictarr/rc/issues/53","id":112522040,"user":{"login":"guyellis","id":2047725,"avatar_url":"https://avatars.githubusercontent.com/u/2047725?v=3","gravatar_id":"","url":"https://api.github.com/users/guyellis","html_url":"https://github.com/guyellis","followers_url":"https://api.github.com/users/guyellis/followers","following_url":"https://api.github.com/users/guyellis/following{/other_user}","gists_url":"https://api.github.com/users/guyellis/gists{/gist_id}","starred_url":"https://api.github.com/users/guyellis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guyellis/subscriptions","organizations_url":"https://api.github.com/users/guyellis/orgs","repos_url":"https://api.github.com/users/guyellis/repos","events_url":"https://api.github.com/users/guyellis/events{/privacy}","received_events_url":"https://api.github.com/users/guyellis/received_events","type":"User","site_admin":false},"created_at":"2015-06-16T18:29:34Z","updated_at":"2015-06-16T18:29:34Z","body":"@dominictarr How would it break other applications?\r\n\r\nIs there a situation where the cwd is not a parent of __dirname?"}}