git-browse/browse-ci: use powershell.exe only when it is available

Signed-off-by: spacewander <spacewanderlzx@gmail.com>
This commit is contained in:
spacewander 2022-04-19 20:51:22 +08:00
parent 716459f79d
commit d17f02979e
2 changed files with 2 additions and 2 deletions

View file

@ -40,7 +40,7 @@ case "$OSTYPE" in
;;
linux*)
# Handle WSL on Windows
if uname -a | grep -i -q Microsoft
if uname -a | grep -i -q Microsoft && command -v powershell.exe
then
powershell.exe -NoProfile start $url
else

View file

@ -51,7 +51,7 @@ case "$OSTYPE" in
;;
linux*)
# Handle WSL on Windows
if uname -a | grep -i -q Microsoft
if uname -a | grep -i -q Microsoft && command -v powershell.exe
then
powershell.exe -NoProfile start "${ci_url}"
else