X-Git-Url: https://git.josue.xyz/?p=webi-installers%2F.git;a=blobdiff_plain;f=golang%2Finstall.sh;fp=golang%2Finstall.sh;h=2df6a91274c2b4a218b0822a6458039dc0d8e882;hp=4530dfa063a52f8472cf3a2372a3e1e850f7d853;hb=ca7a838c6fde6052124947ff442aa9e6056f5e28;hpb=704265583cff80363fec60c4088f5b91f6d98bd0 diff --git a/golang/install.sh b/golang/install.sh index 4530dfa..2df6a91 100644 --- a/golang/install.sh +++ b/golang/install.sh @@ -15,7 +15,7 @@ pkg_cmd_name="go" # # Their defaults are defined in _webi/template.sh at https://github.com/webinstall/packages -pkg_get_current_version() { +function pkg_get_current_version() { # 'go version' has output in this format: # go version go1.14.2 darwin/amd64 # This trims it down to just the version number: @@ -26,13 +26,13 @@ pkg_get_current_version() { sed 's:go::' } -pkg_format_cmd_version() { +function 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() { +function pkg_link() { # 'pkg_dst' will default to $HOME/.local/opt/go # 'pkg_src' will be the installed version, such as to $HOME/.local/opt/go-v1.14.2 rm -rf "$pkg_dst" @@ -47,7 +47,7 @@ pkg_link() { ln -s "$GOBIN_REAL" "$GOBIN" } -pkg_post_install() { +function pkg_post_install() { pkg_link # web_path_add is defined in _webi/template.sh at https://github.com/webinstall/packages @@ -108,7 +108,7 @@ pkg_post_install() { echo "" } -pkg_done_message() { +function pkg_done_message() { echo "Installed 'go v$WEBI_VERSION' to ~/.local/opt/go" # note: literal $HOME on purpose #shellcheck disable=SC2016