From 9ae503e6ed7151d9162f610d7b08e6331b146889 Mon Sep 17 00:00:00 2001 From: Jeff Williams Date: Mon, 24 Sep 2012 08:55:23 -0700 Subject: [PATCH] improve function name --- jsdoc.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/jsdoc.js b/jsdoc.js index 0b044379..4ee67196 100644 --- a/jsdoc.js +++ b/jsdoc.js @@ -229,24 +229,24 @@ function main() { var result; template = template || 'templates/default'; - function noSuchPath(_path) { + function pathExists(_path) { try { fs.readdirSync(_path); } catch(e) { - return true; + return false; } - return false; + return true; } // first, try resolving it relative to the current working directory (or just normalize it // if it's an absolute path) result = path.resolve(template); - if ( noSuchPath(result) ) { + if ( !pathExists(result) ) { // next, try resolving it relative to the JSDoc directory result = path.resolve(env.dirname, template); - if ( noSuchPath(result) ) { + if ( !pathExists(result) ) { // restore the original value so the user gets a reasonable error message result = template; }