# HG changeset patch # User KrzGalcz # Date 1731508234 -3600 # Node ID bf90446a27cb5c54dfa0a4fda87d2e61c35cd88e # Parent 990d3ed1b36b7165a9e87872c9a561f949dc7822 Avoid error is WSL is not defined diff --git a/pre-commit-src/pre-commit-script.sh b/pre-commit-src/pre-commit-script.sh --- a/pre-commit-src/pre-commit-script.sh +++ b/pre-commit-src/pre-commit-script.sh @@ -35,17 +35,17 @@ fi # Mac grep doesn't have Perl regex, therefor it needs to be checked with another method if [ $OSTYPE = 'darwin'* ]; then alias grep='ggrep' else alias grep='command grep' fi # In case on WSL (Windows) it's faster to invoke git.exe directly from Windows (since the files are in the windows FS). -if [ -n $(echo $WSL_DISTRO_NAME || echo '') ]; then +if [ -n "${WSL_DISTRO_NAME:-}" ]; then alias git='git.exe' else alias git='command git' fi error_handler() { local exit_code=$? local line_number=$1