-# The version info should be reduced to a sortable version, without any leading characters
-# (i.e. v12.8.0 => 12.8.0, go1.14 => 1.14, 1.12.13+hotfix => 1.12.13+hotfix)
-pkg_get_current_version() {
- echo "$(xmpl --version 2>/dev/null | head -n 1 | cut -d' ' -f2)"
-}
-
-# For (re-)linking to the desired installed version
-# (for example: 'go' is special and needs both $HOME/go and $HOME/.local/opt/go)
-# (others like 'rg', 'hugo', and 'caddy' are single files that just get replaced)
-pkg_link() {
- rm -rf "$pkg_dst"
- ln -s "$pkg_src" "$pkg_dst"
-}
-
-pkg_pre_install() {
- # web_* are defined in _webi/template.sh at https://github.com/webinstall/packages
-
- # if selected version is installed, re-link it and quit
- webi_check
-
- # will save to ~/Downloads/$WEBI_PKG_FILE by default
- webi_download
-
- # supported formats (.xz, .tar.*, .zip) will be extracted to $WEBI_TMP
- webi_extract
-}
-
-# For installing from the extracted package tmp directory
-pkg_install() {
- # remove the versioned folder, just in case it's there with junk
- rm -rf "$pkg_src"
-
- # rename the entire extracted folder to the new location
- # (this will be "$HOME/.local/opt/xmpl-v$WEBI_VERSION" by default)
- mv ./"$pkg_cmd_name"* "$pkg_src"
-}
-
-# For updating PATHs and installing companion tools
-pkg_post_install() {
- pkg_link
-
- # web_path_add is defined in _webi/template.sh at https://github.com/webinstall/packages
- webi_path_add "$pkg_dst_bin"
-}
-
-pkg_done_message() {
- echo "Installed 'example' as 'xmpl' at $pkg_dst_cmd"
-}