Skip to content

Commit

Permalink
Check for a shebang and remove it if it's there
Browse files Browse the repository at this point in the history
  • Loading branch information
greduan committed Oct 13, 2014
1 parent 8536475 commit 393f9b3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions gulp.jslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,19 @@
return function (src, fn) {
var retVal, js,
lint = function () {
var myRet;
var myRet, str;

// prepare for linting exports
src.jslint = {};

// convert to string
js = src.contents.toString('utf8');

// check for shebang
if (js.substr(0, js.indexOf('\n')).match(/^#! ?/)) {
js = js.replace(js.split('\n', 1) + '\n', '');
}

// lint the file
src.jslint.edition = JSLINT.edition;
src.jslint.success = JSLINT(js, options);
Expand Down Expand Up @@ -125,4 +130,4 @@
// begin linting
return evtStr.map(doLint(options));
};
}());
}());

0 comments on commit 393f9b3

Please sign in to comment.