Skip to content

Commit

Permalink
Do not setup ignore_paths on generate action; set default index here.
Browse files Browse the repository at this point in the history
  • Loading branch information
nporteschaikin committed Oct 23, 2014
1 parent eb45a71 commit 30ed24d
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Config.prototype = {
load_defaults: function () {
this.config.output_path = '.peak';
this.config.port = 1111;
this.config.index = 'index.jade';
},

load_file: function () {
Expand All @@ -41,15 +42,20 @@ Config.prototype = {
}

for (option in this.options_argument) {
if (this.options_argument[option]) options[option] = this.options_argument[option];
if (this.options_argument[option] &&
typeof this.options_argument[option] !== 'function') options[option] = this.options_argument[option];
}

if (!options.ignore_paths instanceof Array) {
options.ignore_paths = [];
}
if (action) {

if (!options.ignore_paths || !options.ignore_paths instanceof Array) {
options.ignore_paths = [];
}

if (options.ignore_paths.indexOf(options.output_path) == -1) {
options.ignore_paths.push(options.output_path);
}

if (options.ignore_paths.indexOf(options.output_path) == -1) {
options.ignore_paths.push(options.output_path);
}

return options;
Expand Down

0 comments on commit 30ed24d

Please sign in to comment.