Skip to content

Commit

Permalink
quick fix for windows so that it looks for node.exe
Browse files Browse the repository at this point in the history
  • Loading branch information
copenhas committed Dec 2, 2011
1 parent 74922b4 commit 3d9f7f7
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,26 @@ module.exports = {
projectConfig = path.join(process.cwd(), '.jshintrc'),
customConfig = options["--config"],
customReporter = options["--reporter"] ? path.resolve(process.cwd(), options["--reporter"]) : null,
targets = typeof options.node === "string" ? null : options.node.slice(1);
targets = options.node;

//could be on Windows which we are looking for an attribute ending in 'node.exe'
if (targets === undefined) {
(function () {
var arg,
tokens;

for (arg in options) {
tokens = arg.split("\\");
if (tokens[tokens.length - 1] === 'node.exe') {
targets = options[arg];
break;
}
}
})();
}

targets = typeof targets === "string" ? null : targets.slice(1);


if (options["--version"]) {
_version();
Expand Down

0 comments on commit 3d9f7f7

Please sign in to comment.