diff --git a/lib/jake.js b/lib/jake.js index 4a34253d..a0f1a894 100644 --- a/lib/jake.js +++ b/lib/jake.js @@ -26,7 +26,7 @@ var JAKE_VERSION = '0.1.5' var usage = '' + 'Node-Jake JavaScript build tool\n' + '********************************************************************************\n' - + 'If no flags are given, Node-Jake looks for a Jakefile.js in the current directory.\n' + + 'If no flags are given, Node-Jake looks for a Jakefile or Jakefile.js in the current directory.\n' + '********************************************************************************\n' + '{Usage}: jake [options] target (commands/options ...)\n' + '\n' @@ -284,10 +284,15 @@ if (typeof opts.version != 'undefined') { } try { - var stats = fs.statSync(jakefile + '.js'); + try{ + var stats = fs.statSync(jakefile + '.js'); + } + catch (e) { + var stats = fs.statSync(jakefile); + } } catch (e) { - jake.die('Could not load Jakefile.\nIf no Jakefile specified with -f or --jakefile, jake looks for Jakefile.js in the current directory.'); + jake.die('Could not load Jakefile.\nIf no Jakefile specified with -f or --jakefile, jake looks for Jakefile or Jakefile.js in the current directory.'); } try {