1
0
mirror of https://github.com/oh-my-fish/theme-bobthefish.git synced 2024-10-27 20:34:23 +00:00

Removing some un-needed code

This commit is contained in:
Sean Patrick Hagen 2022-06-17 12:26:05 -07:00
parent 64a6f8ee18
commit 20eb30bf4f
No known key found for this signature in database
GPG Key ID: 618FC6E1C001EE4F

View File

@ -853,21 +853,6 @@ function __bobthefish_prompt_golang -S -d 'Display current Go information'
[ "$theme_display_go" = 'no' ] [ "$theme_display_go" = 'no' ]
and return and return
set -l go_version
if type -fq asdf
set -l asdf_golang_version (asdf current golang 2>/dev/null)
set -l asdf_go_sdk_version (asdf current go-sdk 2>/dev/null)
if [ "$asdf_golang_version" != "na" ]
echo "$asdf_golang_version" | read _asdf_plugin asdf_go_version asdf_provenance
else if [ "$asdf_go_sdk_version" != "na" ]
echo "$asdf_go_sdk_version" | read _asdf_plugin asdf_go_version asdf_provenance
end
set go_version $asdf_go_version
end
set -l cwd (pwd) set -l cwd (pwd)
set -l dir (pwd) set -l dir (pwd)
set -l found_gomod 0 set -l found_gomod 0
@ -895,18 +880,18 @@ function __bobthefish_prompt_golang -S -d 'Display current Go information'
end end
# check if there's a Go executable # check if there's a Go executable
set -l no_go_installed 0 set -l no_go_installed "0"
set -l actual_go_version 0 set -l actual_go_version "0"
if ! type -fq go if type -fq go
set no_go_installed 1 set actual_go_version (go version | string match -r 'go version go(\\d+\\.\\d+)' -g)
else else
set actual_go_version (go version | string match -r 'go version go(\\d+\\.\\d+)' -g) set no_go_installed "1"
end end
set -l high_enough_version 0 set -l high_enough_version "0"
if test "$no_go_installed" -eq "0" if [ "$no_go_installed" = "0" ]
if printf "%s\n%s" "$gomod_version" "$actual_go_version" | sort --check=silent --version-sort if printf "%s\n%s" "$gomod_version" "$actual_go_version" | sort --check=silent --version-sort
set high_enough_version 1 set high_enough_version "1"
end end
end end
@ -916,14 +901,18 @@ function __bobthefish_prompt_golang -S -d 'Display current Go information'
# do we show the version in red if it's not the right version? # do we show the version in red if it's not the right version?
if [ "$theme_display_go_show_wrong_version" = "yes" ] if [ "$theme_display_go_show_wrong_version" = "yes" ]
# yes we do, so check if the version is high enough # yes we do, so check if the version is high enough
if test "$high_enough_version" -eq "0" if [ "$high_enough_version" = "0" ]
# the version of go isn't high enough # the version of go isn't high enough
__bobthefish_start_segment $color_rvm __bobthefish_start_segment $color_rvm
end end
end end
if [ "$theme_display_go_actual" = "yes" ] if [ "$theme_display_go_actual" = "yes" ]
echo -ns "$actual_go_version" if [ "$actual_go_version" = "0" ]
echo -ns "(NA)"
else
echo -ns "($actual_go_version)"
end
else else
echo -ns "$gomod_version" ' ' echo -ns "$gomod_version" ' '
if [ "$theme_display_go_actual" = "diff" ] if [ "$theme_display_go_actual" = "diff" ]