Skip to content

Commit

Permalink
renamed the settings file to nightwatch.json - #68
Browse files Browse the repository at this point in the history
  • Loading branch information
beatfactor committed Feb 28, 2014
1 parent 66623d6 commit ebb16fa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
File renamed without changes.
12 changes: 10 additions & 2 deletions bin/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cli.command('config')
.demand(true)
.description('Path to configuration file')
.alias('c')
.defaults('./settings.json');
.defaults('./nightwatch.json');

// $ nightwatch -o
// $ nightwatch --output
Expand Down Expand Up @@ -100,11 +100,19 @@ function readSettings(argv) {
// use default settings.json file if we haven't received another value
if (cli.command('config').isDefault(argv.c)) {
var defaultValue = cli.command('config').defaults();
var deprecatedValue = './settings.json';

if (fs.existsSync(defaultValue)) {
argv.c = path.join(path.resolve('./'), argv.c);
} else if (fs.existsSync(deprecatedValue)) {
argv.c = path.join(path.resolve('./'), deprecatedValue);
} else {
argv.c = path.join(__dirname, argv.c);
var defaultFile = path.join(__dirname, argv.c);
if (fs.existsSync(defaultFile)) {
argv.c = defaultFile;
} else {
argv.c = path.join(__dirname, deprecatedValue);
}
}
} else {
argv.c = path.resolve(argv.c);
Expand Down

0 comments on commit ebb16fa

Please sign in to comment.