Permalink
Browse files

include and update other modules jshint loads

These modules are located in the same directory as
jshint.js and are loaded when jshint starts.

Update them when jshint.js is updated.
  • Loading branch information...
1 parent fa5ca74 commit 3f7091b8c1311154af3d1575ca19f39e3c598989 @stepheneb stepheneb committed Sep 8, 2013
Showing with 7,596 additions and 4,309 deletions.
  1. +23 −18 Support/jshint-tm.js
  2. +4,844 −4,291 Support/jshint.js
  3. +1,694 −0 Support/lex.js
  4. +218 −0 Support/messages.js
  5. +34 −0 Support/reg.js
  6. +24 −0 Support/state.js
  7. +171 −0 Support/style.js
  8. +588 −0 Support/vars.js
View
@@ -21,23 +21,28 @@ function html(s) {
* Downloads the latest JSHint version from GitHub and invokes the callback when done.
* https://raw.github.com/jshint/jshint/master/src/jshint.js
*/
-function download_jshint(ready) {
- var req = https.get({host: 'raw.github.com', port: 443, path: '/jshint/jshint/master/src/jshint.js'}, function(res) {
- if (res.statusCode === 200) {
- res.setEncoding('utf8');
- var data = '';
- res.on('data', function(chunk) {
- data += chunk;
- });
- res.on('end', function() {
- fs.writeFile(jshintPath, data, ready);
- });
- }
- else {
- ready('Download of jshint.js failed. HTTP status code: ' + res.statusCode);
- }
- }).on('error', function(err) {
- ready('Download of jshint.js failed: ' + html(err.message));
+function download_jshint_resources(ready) {
+ var req,
+ resources = ["jshint.js", "vars.js", "messages.js", "lex.js", "reg.js", "state.js", "style.js"];
+
+ resources.forEach(function(resource) {
+ req = https.get({host: 'raw.github.com', port: 443, path: '/jshint/jshint/master/src/' + resource}, function(res) {
+ if (res.statusCode === 200) {
+ res.setEncoding('utf8');
+ var data = '';
+ res.on('data', function(chunk) {
+ data += chunk;
+ });
+ res.on('end', function() {
+ fs.writeFile(__dirname + '/' + resource, data, ready);
+ });
+ }
+ else {
+ ready('Download of ' + resource + ' failed. HTTP status code: ' + res.statusCode);
+ }
+ }).on('error', function(err) {
+ ready('Download of ' + resource + ' failed: ' + html(err.message));
+ });
});
}
@@ -87,7 +92,7 @@ function download(callback) {
function done(err) {
callback(err);
}
- download_jshint(function (err) {
+ download_jshint_resources(function (err) {
if (err) {
done(err);
} else {
View

Large diffs are not rendered by default.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 3f7091b

Please sign in to comment.