Skip to content

Commit

Permalink
buld:Enable running pre-commit ClangFormat on Win
Browse files Browse the repository at this point in the history
  • Loading branch information
vmoroz authored and mhdawson committed Mar 31, 2022
1 parent 8c46a95 commit 57c212e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
/benchmark/build
/benchmark/src
/test/addon_build/addons
/.vscode
5 changes: 4 additions & 1 deletion tools/clang-format.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ function main (args) {
}

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

0 comments on commit 57c212e

Please sign in to comment.