Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Make executable process file regardless of extension if file path (no…
…t directory path) is passed in as arg
  • Loading branch information
dburrows committed Jul 3, 2014
commit ee7b71a2e5dab0022279d76cb87dab3f4e33cd1b
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);
}
}
}