Skip to content

Commit 03c30c6

Browse files
committed
fix: jshint works on Windows
run-tests.js previously relied on shell wildcard expansion, and did not specify full paths. This uses common.expand to handle globbing internally, and specifies the full path, so jshint can find all the files.
1 parent 15261f8 commit 03c30c6

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

scripts/generate-docs.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env node
2+
/* globals cd, echo, grep, sed */
23
require('../global');
34

45
echo('Appending docs to README.md');

scripts/run-tests.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
#!/usr/bin/env node
2+
/* globals cd, echo, exec, exit, ls, pwd, test */
23
require('../global');
3-
4-
var path = require('path');
4+
var common = require('../src/common');
55

66
var failed = false;
77

88
//
99
// Lint
1010
//
11-
JSHINT_BIN = './node_modules/jshint/bin/jshint';
11+
var JSHINT_BIN = 'node_modules/jshint/bin/jshint';
1212
cd(__dirname + '/..');
1313

1414
if (!test('-f', JSHINT_BIN)) {
1515
echo('JSHint not found. Run `npm install` in the root dir first.');
1616
exit(1);
1717
}
1818

19-
if (exec(JSHINT_BIN + ' *.js test/*.js').code !== 0) {
19+
var jsfiles = common.expand([pwd() + '/*.js',
20+
pwd() + '/scripts/*.js',
21+
// pwd() + '/src/*.js',
22+
pwd() + '/test/*.js'
23+
]).join(' ');
24+
if (exec('node ' + pwd() + '/' + JSHINT_BIN + ' ' + jsfiles).code !== 0) {
2025
failed = true;
2126
echo('*** JSHINT FAILED! (return code != 0)');
2227
echo();

0 commit comments

Comments
 (0)