# 'caddy version' has output in this format:
# v2.1.0 h1:pQSaIJGFluFvu8KDGDODV8u4/QRED/OPyIR+MWYYse8=
# This trims it down to just the version number:
- # 2.0.0
+ # 2.1.0
echo "$(caddy version 2>/dev/null | head -n 1 | cut -d' ' -f1 | sed 's:^v::')"
}
pkg_install() {
- # $HOME/.local/xbin
+ # $HOME/.local/opt/caddy-v2.1.0/bin
mkdir -p "$pkg_src_bin"
- # mv ./caddy* "$HOME/.local/xbin/caddy-v2.0.0"
+ # mv ./caddy* "$HOME/.local/opt/caddy-v2.1.0/bin/caddy"
mv ./"$pkg_cmd_name"* "$pkg_src_cmd"
- # chmod a+x "$HOME/.local/xbin/caddy-v2.0.0"
+ # chmod a+x "$HOME/.local/opt/caddy-v2.1.0/bin/caddy"
chmod a+x "$pkg_src_cmd"
}
# rm -f "$HOME/.local/bin/caddy"
rm -f "$pkg_dst_cmd"
- # ln -s "$HOME/.local/xbin/caddy-v2.0.0" "$HOME/.local/bin/caddy"
+ # ln -s "$HOME/.local/opt/caddy-v2.1.0/bin/caddy" "$HOME/.local/bin/caddy"
ln -s "$pkg_src_cmd" "$pkg_dst_cmd"
}
dotenv: a cross-platform tool to load a .env and run a command.
---
-## Updating `dotenv`
-
-```bash
-webi dotenv@stable
-```
-
-Use the `@beta` tag for pre-releases, or `@x.y.z` for a specific version.
+To update or switch versions, run `webi dotenv@stable`.
## Cheat Sheet
# mv ./dotenv* "$HOME/.local/opt/dotenv-v1.0.0/bin/dotenv"
mv ./"$pkg_cmd_name"* "$pkg_src_cmd"
- # chmod a+x "$HOME/.local/xbin/dotenv-v1.0.0/bin/dotenv"
+ # chmod a+x "$HOME/.local/opt/dotenv-v1.0.0/bin/dotenv"
chmod a+x "$pkg_src_cmd"
}
pkg_get_current_version() {
# 'dotenv version' has output in this format:
- # v2.1.0 h1:pQSaIJGFluFvu8KDGDODV8u4/QRED/OPyIR+MWYYse8=
+ # dotenv v1.0.0 (17c7677) 2020-10-19T23:43:57Z
# This trims it down to just the version number:
- # 2.0.0
+ # 1.0.0
echo "$(dotenv --version 2>/dev/null | head -n 1 | cut -d' ' -f2 | sed 's:^v::')"
}