Skip to content

Commit

Permalink
Check for githooks configuration on Windows
Browse files Browse the repository at this point in the history
Follow-up to #1059
and #1060
  • Loading branch information
ohodson committed Sep 1, 2023
1 parent 481804f commit a6f0ce1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ build:asan --test_env=ASAN_OPTIONS=abort_on_error=true
#
# Linux and macOS
#
build:unix --workspace_status_command=./build/scripts/workspace-status.sh
build:unix --workspace_status_command=./tools/unix/workspace-status.sh

build:unix --cxxopt='-std=c++20' --host_cxxopt='-std=c++20'
build:unix --cxxopt='-stdlib=libc++' --host_cxxopt='-stdlib=libc++'
Expand Down Expand Up @@ -124,6 +124,7 @@ build:linux --force_pic

# See https://bazel.build/configure/windows#symlink
startup --windows_enable_symlinks
build:windows --workspace_status_command=./tools/windows/workspace-status.cmd
build:windows --enable_runfiles
# We use LLVM's MSVC-compatible compiler driver to compile our code on Windows,
# as opposed to using MSVC directly. This enables us to use the "same" compiler
Expand Down
File renamed without changes.
18 changes: 18 additions & 0 deletions tools/windows/workspace-status.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@setlocal enabledelayedexpansion
@echo off

@rem find git.exe
for /F "tokens=* USEBACKQ" %%F in (`where git.exe`) do (
set "GIT=%%F"
break
)

@rem Git's bash is located at %GITINSTALLDIR%\bin\bash.exe
@rem Git's git.exe is located at %GITINSTALLDIR%\cmd\git.exe
set "GITEXEDIR=%GIT:git.exe=%"
set "BASH=%GITEXEDIR%\..\bin\bash.exe"

@rem Change to the directory of this script (tools/windows) to
@rem run bash script in (tools/unix).
cd "%~dp0"
"%BASH%" -c ../unix/workspace-status.sh

0 comments on commit a6f0ce1

Please sign in to comment.