From fe5487ad3371044499ceab92a3376e9ed8fddd70 Mon Sep 17 00:00:00 2001 From: Mike Lewis Date: Mon, 30 Nov 2020 18:56:51 -0800 Subject: [PATCH] Fix bash compatibility The use of zsh `&!` syntax was causing bash to die in script parsing, even though this never gets executed. This adds `true` as a dummy command to get past parsing and allow both bash and zsh to execute the script. --- gitprompt.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gitprompt.sh b/gitprompt.sh index 55b772c..f23a134 100755 --- a/gitprompt.sh +++ b/gitprompt.sh @@ -12,7 +12,9 @@ function async_run() { function async_run_zsh() { { eval "$@" &> /dev/null - }&! + + # `true` is used here to allow bash to parse the script, as the zsh `&!` syntax will otherwise stop parsing prior to any execution. + }&! true }