-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added handling of Jakefile along with Jakefile.js
- Loading branch information
Showing
1 changed file
with
8 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84bb0c2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it could be simply
var exists = path.existsSync(jakefile + '.js') || path.existsSync(jakefile);
if(!exists) {
jake.die('Could not load Jakefile.\nIf no Jakefile specified with -f or --jakefile, jake looks for Jakefile.js or Jakefile in the current directory.');
}
84bb0c2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mea culpa, I have not grokked node API completely yet.
84bb0c2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're all learning the API. :) I didn't get what c4milo was doing with this when I was comparing the two different sets. I'll update the code to use path.existsSync. Very nice!
84bb0c2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see, the sync version is undocumented. Still seems like a good improvement.
84bb0c2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, it's embarrassing. There are still some functions undocumented in nodejs
84bb0c2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's possible this is deliberately undocumented, being a sync call. :)
84bb0c2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahaha who knows