From: AJ ONeal Date: Sun, 14 Jun 2020 08:25:09 +0000 (-0600) Subject: add pkg_format_cmd_version X-Git-Url: https://git.josue.xyz/?a=commitdiff_plain;h=e7d03a301c5fb66bbe56d81dd3bed9c0fa28c447;p=webi-installers%2F.git add pkg_format_cmd_version --- diff --git a/golang/install.bash b/golang/install.bash index 6d84d4e..af3c34e 100644 --- a/golang/install.bash +++ b/golang/install.bash @@ -56,6 +56,12 @@ pkg_get_current_version() { echo "$(go version | cut -d' ' -f3 | sed 's:go::')" } +pkg_format_cmd_version() { + # 'go v1.14.0' will be 'go1.14' + my_version=$(echo "$1" | sed 's:\.0::g') + echo "${pkg_cmd_name}${my_version}" +} + pkg_link_new_version() { # 'pkg_common_opt' will default to $HOME/.local/opt/go # 'pkg_new_opt' will be the installed version, such as to $HOME/.local/opt/go-v1.14.2