Skip to content

Commit

Permalink
Use absolute paths to config files to fix #1
Browse files Browse the repository at this point in the history
  • Loading branch information
joelpurra committed Nov 15, 2012
1 parent be07015 commit 47e9f1f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
12 changes: 3 additions & 9 deletions lib/configvention.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,13 @@ var exported = (function() {

priv.nconf = require("nconf");

priv.getFilename = function(fullpath) {
var path = require("path");

return path.basename(fullpath);
};

priv.initialize = function() {
var appFilename = priv.getFilename(require.main.filename);
var appPath = require.main.filename;

priv.nconf.argv().env().file({
file: appFilename + ".config.json"
file: appPath + ".config.json"
}).file({
file: appFilename + ".defaults.config.json"
file: appPath + ".defaults.config.json"
});
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "configvention",
"version": "1.0.0",
"version": "1.0.1",
"author": {
"name": "Joel Purra",
"email": "code+npm@joelpurra.com",
Expand Down

0 comments on commit 47e9f1f

Please sign in to comment.