#
# 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:
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"
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
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