Skip to content

Commit

Permalink
Make executable process file regardless of extension if file path (no…
Browse files Browse the repository at this point in the history
…t directory path) is passed in as arg
  • Loading branch information
dburrows committed Jul 3, 2014
1 parent f55b21d commit ee7b71a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions bin/htmlhint
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,16 @@ function getAllFiles(arrTargets){
var arrAllFiles = [];
if(arrTargets.length > 0){
for(var i=0,l=arrTargets.length;i<l;i++){
getFiles(arrTargets[i], arrAllFiles);
var filepath = path.resolve(process.cwd(), arrTargets[i]);
if(fs.existsSync(filepath) !== false){
if(fs.statSync(filepath).isFile) {
arrAllFiles.push(filepath);
} else {
getFiles(arrTargets[i], arrAllFiles);
}
} else {
console.log('File %s does not exist'.red, arrTargets[i]);
}
}
}
else{
Expand Down Expand Up @@ -144,4 +153,4 @@ function quit(code){
} else {
process.exit(code || 0);
}
}
}

0 comments on commit ee7b71a

Please sign in to comment.