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

Allow to read file with same name after changing current working directory #101

Open
pvdlg opened this issue Nov 5, 2017 · 0 comments
Open

Comments

@pvdlg
Copy link

pvdlg commented Nov 5, 2017

Currently it seems rc caches the file content by name rather than using the full path of the file.
That create a situation in which a given filename won't be loaded if the same filename was loaded from another directory before.

Here is the steps to reproduce:

// File `/directory_1/myapprc`
property = 1
// File `/directory_2/myapprc`
property = 2
process.chdir('/directory_1');
var conf1 = require('rc')('myapprc');
console.log(conf1.property);
// 1

process.chdir('/directory_2');
var conf2 = require('rc')('myapprc');
console.log(conf2.property);
// 1 => should be 2
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

1 participant