diff --git a/package.json b/package.json index faad4e2c61a..9f0d3e66bb7 100644 --- a/package.json +++ b/package.json @@ -44,19 +44,19 @@ "bump-version": "./script/bump-version.py", "check-tls": "python ./script/tls.py", "clang-format": "find atom/ brightray/ chromium_src/ -iname *.h -o -iname *.cc -o -iname *.mm | xargs clang-format -i", - "lint": "./script/lint.js && npm run lint:clang-format && npm run lint:docs", - "lint:js": "./script/lint.js --js", + "lint": "node ./script/lint.js && npm run lint:clang-format && npm run lint:docs", + "lint:js": ".node /script/lint.js --js", "lint:clang-format": "python script/run-clang-format.py -r -c atom/ chromium_src/ brightray/ || (echo \"\\nCode not formatted correctly.\" && exit 1)", - "lint:cpp": "./script/lint.js --cc", - "lint:py": "./script/lint.js --py", - "lint:gn": "./script/lint.js --gn", + "lint:cpp": "node ./script/lint.js --cc", + "lint:py": "node ./script/lint.js --py", + "lint:gn": "node ./script/lint.js --gn", "lint:docs": "remark docs -qf && npm run lint:js-in-markdown && npm run create-typescript-definitions && npm run lint:docs-relative-links", "lint:docs-relative-links": "python ./script/check-relative-doc-links.py", "lint:js-in-markdown": "standard-markdown docs", "create-api-json": "electron-docs-linter docs --outfile=electron-api.json", "create-typescript-definitions": "npm run create-api-json && electron-typescript-definitions --in=electron-api.json --out=electron.d.ts", "preinstall": "node -e 'process.exit(0)'", - "precommit": "python script/run-clang-format.py -r -c atom/ chromium_src/ brightray/ && ./script/lint.js -c && remark docs -qf || (echo \"Code not formatted correctly.\" && exit 1)", + "precommit": "python script/run-clang-format.py -r -c atom/ chromium_src/ brightray/ && node ./script/lint.js -c && remark docs -qf || (echo \"Code not formatted correctly.\" && exit 1)", "prepack": "check-for-leaks", "prepush": "check-for-leaks", "repl": "node ./script/start.js --interactive", diff --git a/script/lint.js b/script/lint.js index e135a9a9c46..a06305d17f3 100755 --- a/script/lint.js +++ b/script/lint.js @@ -94,7 +94,7 @@ const LINTERS = [ { const allOk = filenames.map(filename => { const args = ['format', filename] if (!opts.fix) args.push('--dry-run') - const result = childProcess.spawnSync('gn', args, { stdio: 'inherit' }) + const result = childProcess.spawnSync('gn', args, { stdio: 'inherit', shell: true }) if (result.status === 0) { return true } else if (result.status === 2) {