Skip to content

Commit

Permalink
fix conf.json issues
Browse files Browse the repository at this point in the history
- don't try to create conf.json if it doesn't exist (resolves a
permissions issue when installing with npm -g)
- add default values for recently added properties (hopefully fixes
Travis CI build)
  • Loading branch information
hegemonic committed Dec 3, 2012
1 parent 3227854 commit d2d05fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 5 additions & 0 deletions conf.json.EXAMPLE
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,10 @@
"excludePattern": "(^|\\/|\\\\)_"
},
"plugins": [],
"templates": {
"docletFormat": "taffydb",
"cleverLinks": false,
"monospaceLinks": false
},
"jsVersion": 180
}
7 changes: 3 additions & 4 deletions jsdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,13 +310,12 @@ function main() {
env.opts = jsdoc.opts.args.parse(env.args);

try {
env.conf = new Config( fs.readFileSync( env.opts.configure || env.dirname + '/conf.json' ) ).get();
env.conf = new Config( fs.readFileSync( path.join(env.opts.configure || env.dirname, 'conf.json') ) ).get();
}
catch (e) {
try {
//Try to copy over the example conf
var example = fs.readFileSync(env.dirname + '/conf.json.EXAMPLE', 'utf8');
fs.writeFileSync(env.dirname + '/conf.json', example, 'utf8');
// Use the example file if possible
var example = fs.readFileSync(path.join(env.dirname, 'conf.json.EXAMPLE'), 'utf8');
env.conf = JSON.parse(example);
}
catch(e) {
Expand Down

0 comments on commit d2d05fc

Please sign in to comment.