check-all: Use more fs / path functions

(imported from commit f2b2970efa9b93068f835cd70ca3e3cc7ec22c38)
This commit is contained in:
Keegan McAllister 2012-10-04 13:15:37 -04:00
parent 15a99f6be2
commit 3816ca6dfb
1 changed files with 4 additions and 3 deletions

View File

@ -73,9 +73,10 @@ var exceptions = {
var fs = require('fs'); var fs = require('fs');
var JSLINT = require(__dirname + '/jslint').JSLINT; var path = require('path');
var JSLINT = require(path.join(__dirname, 'jslint')).JSLINT;
var js_dir = __dirname + '/../../zephyr/static/js/'; var js_dir = fs.realpathSync(path.join(__dirname, '../../zephyr/static/js'));
var exit_code = 0; var exit_code = 0;
@ -83,7 +84,7 @@ fs.readdirSync(js_dir).forEach(function (filename) {
if (filename.slice('-3') !== '.js') if (filename.slice('-3') !== '.js')
return; return;
var contents = fs.readFileSync(js_dir + filename, 'utf8'); var contents = fs.readFileSync(path.join(js_dir, filename), 'utf8');
var messages = []; var messages = [];
if (!JSLINT(contents, jslint_options)) { if (!JSLINT(contents, jslint_options)) {