Skip to content

Commit

Permalink
Fix bash compatibility
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
MPLew-is authored and guenhter committed Feb 21, 2023
1 parent 3930480 commit fe5487a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gitprompt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}


Expand Down

0 comments on commit fe5487a

Please sign in to comment.