Skip to content

Commit 900384b

Browse files
committed
Now runs jshint on the src/ folder. This fixes the pre-existing lint issues
1 parent 03c30c6 commit 900384b

7 files changed

Lines changed: 11 additions & 9 deletions

File tree

scripts/run-tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ if (!test('-f', JSHINT_BIN)) {
1818

1919
var jsfiles = common.expand([pwd() + '/*.js',
2020
pwd() + '/scripts/*.js',
21-
// pwd() + '/src/*.js',
21+
pwd() + '/src/*.js',
2222
pwd() + '/test/*.js'
2323
]).join(' ');
2424
if (exec('node ' + pwd() + '/' + JSHINT_BIN + ' ' + jsfiles).code !== 0) {

src/chmod.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,12 @@ function _chmod(options, mode, filePattern) {
183183
}
184184

185185
if (options.verbose) {
186-
log(file + ' -> ' + newPerms.toString(8));
186+
console.log(file + ' -> ' + newPerms.toString(8));
187187
}
188188

189189
if (perms != newPerms) {
190190
if (!options.verbose && options.changes) {
191-
log(file + ' -> ' + newPerms.toString(8));
191+
console.log(file + ' -> ' + newPerms.toString(8));
192192
}
193193
fs.chmodSync(file, newPerms);
194194
perms = newPerms; // for the next round of changes!

src/error.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ var common = require('./common');
66
//@ otherwise returns string explaining the error
77
function error() {
88
return common.state.error;
9-
};
9+
}
1010
module.exports = error;

src/exec.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,10 @@ function execSync(cmd, opts) {
6464
maxBuffer: 20*1024*1024
6565
};
6666

67+
var script;
68+
6769
if (typeof child.execSync === 'function') {
68-
var script = [
70+
script = [
6971
"var child = require('child_process')",
7072
" , fs = require('fs');",
7173
"var childProcess = child.exec('"+escape(cmd)+"', {env: process.env, maxBuffer: 20*1024*1024}, function(err) {",
@@ -97,7 +99,7 @@ function execSync(cmd, opts) {
9799
} else {
98100
cmd += ' > '+stdoutFile+' 2> '+stderrFile; // works on both win/unix
99101

100-
var script = [
102+
script = [
101103
"var child = require('child_process')",
102104
" , fs = require('fs');",
103105
"var childProcess = child.exec('"+escape(cmd)+"', {env: process.env, maxBuffer: 20*1024*1024}, function(err) {",

src/pwd.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var common = require('./common');
44
//@
55
//@ ### pwd()
66
//@ Returns the current directory.
7-
function _pwd(options) {
7+
function _pwd() {
88
var pwd = path.resolve(process.cwd());
99
return common.ShellString(pwd);
1010
}

src/rm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function rmdirSyncRecursive(dir, force) {
5353
while (true) {
5454
try {
5555
result = fs.rmdirSync(dir);
56-
if (fs.existsSync(dir)) throw { code: "EAGAIN" }
56+
if (fs.existsSync(dir)) throw { code: "EAGAIN" };
5757
break;
5858
} catch(er) {
5959
// In addition to error codes, also check if the directory still exists and loop again if true

src/which.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function splitPath(p) {
1414
}
1515

1616
function checkPath(path) {
17-
return fs.existsSync(path) && fs.statSync(path).isDirectory() == false;
17+
return fs.existsSync(path) && !fs.statSync(path).isDirectory();
1818
}
1919

2020
//@

0 commit comments

Comments
 (0)