Skip to content

Commit 57c212e

Browse files
vmorozmhdawson
authored andcommitted
buld:Enable running pre-commit ClangFormat on Win
1 parent 8c46a95 commit 57c212e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
/benchmark/build
44
/benchmark/src
55
/test/addon_build/addons
6+
/.vscode

tools/clang-format.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ function main (args) {
2020
}
2121

2222
const clangFormatPath = path.dirname(require.resolve('clang-format'));
23-
const options = ['--binary=node_modules/.bin/clang-format', '--style=file'];
23+
const binary = process.platform === 'win32'
24+
? 'node_modules\\.bin\\clang-format.cmd'
25+
: 'node_modules/.bin/clang-format';
26+
const options = ['--binary=' + binary, '--style=file'];
2427
if (fix) {
2528
options.push(FORMAT_START);
2629
} else {

0 commit comments

Comments
 (0)