-###################
-# Install foobar #
-###################
-
-common_opt="${HOME}/.local/opt/foobar-v${WEBI_VERSION}"
-new_opt="${HOME}/.local/opt/foobar-v${WEBI_VERSION}"
-new_bin="${HOME}/.local/opt/foobar-v${WEBI_VERSION}/bin/foobar"
-
-update_installed() {
- rm -rf "$common_opt"
- ln -s "$new_opt" "$common_opt"
-
- # TODO get better output from pathman / output the path to add as return to webi bootstrap
- webi_path_add "$common_opt/bin"
- webi_path_add "$HOME/foobar/bin"
+## The defaults can be assumed if these are not set
+
+## The command name may be different from the package name
+## (i.e. golang => go, rustlang => cargo, ripgrep => rg)
+## Note: $HOME may contain special characters and should alway be quoted
+
+pkg_cmd_name="xmpl"
+
+## Some of these directories may be the same, in some cases
+#pkg_common_opt="$HOME/.local/opt/xmpl"
+#pkg_common_bin="$HOME/.local/opt/xmpl/bin"
+#pkg_common_cmd="$HOME/.local/opt/xmpl/bin/xmpl"
+
+#pkg_new_opt="$HOME/.local/opt/xmpl-v$WEBI_VERSION"
+#pkg_new_bin="$HOME/.local/opt/xmpl-v$WEBI_VERSION/bin"
+#pkg_new_cmd="$HOME/.local/opt/xmpl-v$WEBI_VERSION/bin/xmpl"
+
+# Different packages represent the version in different ways
+# ex: node v12.8.0 (leading 'v')
+# ex: go1.14 (no space, nor trailing '.0's)
+# ex: flutter 1.17.2 (plain)
+pkg_format_cmd_version() {
+ my_version=$1
+ echo "$pkg_cmd_name v$my_version"