From e3b4d4eafc23516e35f162686f08a42edf844e40 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Tue, 24 Sep 2024 09:25:17 -0400 Subject: [PATCH] Use string replace rather than match -g to find go version Fixes #372 --- functions/fish_prompt.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/fish_prompt.fish b/functions/fish_prompt.fish index 123c702..8e67d21 100644 --- a/functions/fish_prompt.fish +++ b/functions/fish_prompt.fish @@ -873,7 +873,7 @@ function __bobthefish_prompt_golang -S -a real_pwd -d 'Display current Go inform set -l actual_go_version "0" set -l high_enough_version "0" if command -q go - set actual_go_version (go version | string match -r 'go version go(\\d+\\.\\d+(?:\\.\\d+)?)' -g) + set actual_go_version (go version | string replace --filter -r 'go version go(\\d+\\.\\d+(?:\\.\\d+)?).*' '$1') if printf "%s\n%s" "$gomod_version" "$actual_go_version" | sort --check=silent --version-sort set high_enough_version "1" end