Skip to content

Commit

Permalink
Enforce using the right bash.exe on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
timwoj committed Jan 13, 2025
1 parent 9ab2c72 commit f01fdfa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion btest
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,10 @@ def _build_win_subprocess_cmd_script(cmd, tmpdir=None):
tf.write(fcontents)
tf.flush()

bash_cmd = ["bash.exe", "-c", normalize_path(tf.name)]
# If you have Windows 11 and WSL2, it defaults to calling "Microsoft Bash Launcher"
# even if gitbash is in your path first. Who knows why. Using shutil.which here
# forces it to call the right thing.
bash_cmd = [shutil.which("bash.exe"), "-c", normalize_path(tf.name)]
return tf, bash_cmd


Expand Down

0 comments on commit f01fdfa

Please sign in to comment.