Skip to content

Commit

Permalink
fix(config): Check if configFilePath is a string.
Browse files Browse the repository at this point in the history
Fixes #447.
  • Loading branch information
dignifiedquire committed Apr 1, 2013
1 parent bfd76b9 commit 98724b6
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ var readConfigFile = function(filepath) {

var parseConfig = function(configFilePath, cliOptions) {

var configFromFile = configFilePath ? readConfigFile(configFilePath) : {};
var configFromFile = helper.isString(configFilePath) ? readConfigFile(configFilePath) : {};

// default config
var config = {
Expand Down Expand Up @@ -236,11 +236,13 @@ var parseConfig = function(configFilePath, cliOptions) {
}
});

// resolve basePath
config.basePath = path.resolve(path.dirname(configFilePath), config.basePath);
if (helper.isString(configFilePath)) {
// resolve basePath
config.basePath = path.resolve(path.dirname(configFilePath), config.basePath);

// always ignore the config file itself
config.exclude.push(configFilePath);
// always ignore the config file itself
config.exclude.push(configFilePath);
}

return normalizeConfig(config);
};
Expand Down

0 comments on commit 98724b6

Please sign in to comment.