From eb11b0149d6c8c0060bb384bb5e96ae373961ca9 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sun, 13 Nov 2022 21:55:12 +0200 Subject: [PATCH] tools: fix git_pre_commit_hook.vsh on windows --- cmd/tools/git_pre_commit_hook.vsh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/tools/git_pre_commit_hook.vsh b/cmd/tools/git_pre_commit_hook.vsh index ee80615057..42dffb5a60 100755 --- a/cmd/tools/git_pre_commit_hook.vsh +++ b/cmd/tools/git_pre_commit_hook.vsh @@ -25,7 +25,7 @@ import term fn main() { // This hook cares only about the changed V files, that will be commited, as reported by git itself: - changed := os.execute("git diff --cached --name-only --diff-filter=ACMR -- '*.v' '*.vsh' '*.vv'") + changed := os.execute('git diff --cached --name-only --diff-filter=ACMR -- "*.v" "*.vsh" "*.vv"') if changed.output == '' { eprintln('>>> 0 changed V files found.') exit(0) @@ -43,7 +43,8 @@ fn main() { for vfile in vfiles { eprintln(' ${term.bold('$vfile')}') } - os.system('v fmt -w ${vfiles.join(' ')}') - os.system('git add ${vfiles.join(' ')}') + all_vfiles_on_a_line := vfiles.map(os.quoted_path(it)).join(' ') + os.system('v fmt -w $all_vfiles_on_a_line') + os.system('git add $all_vfiles_on_a_line') } }