```bash
webi_check # Checks to see if the selected version is already installed (and re-links if so)
-webi_download # Downloads the selected release to $HOME/Downloads/<package-name>.tar.gz
+webi_download # Downloads the selected release to $HOME/Downloads/webi/<package-name>.tar.gz
webi_extract # Extracts the download to /tmp/<package-name>-<random>/
webi_path_add /new/path # Adds /new/path to PATH for bash, zsh, and fish
webi_pre_install # Runs webi_check, webi_download, and webi_extract
WEBI_TMP=${WEBI_TMP:-"$(mktemp -d -t webinstall-"${WEBI_PKG:-}".XXXXXXXX)"}
export _webi_tmp="${_webi_tmp:-"$HOME/.local/opt/webi-tmp.d"}"
- mkdir -p "$HOME/Downloads"
+ mkdir -p "$HOME/Downloads/webi"
mkdir -p "$HOME/.local/bin"
mkdir -p "$HOME/.local/opt"
if [ -n "${2:-}" ]; then
my_dl="$2"
else
- my_dl="$HOME/Downloads/$WEBI_PKG_FILE"
+ my_dl="$HOME/Downloads/webi/$WEBI_PKG_FILE"
fi
WEBI_PKG_DOWNLOAD="${my_dl}"
webi_extract() {
pushd "$WEBI_TMP" > /dev/null 2>&1
if [ "tar" == "$WEBI_EXT" ]; then
- echo "Extracting $HOME/Downloads/$WEBI_PKG_FILE"
- tar xf "$HOME/Downloads/$WEBI_PKG_FILE"
+ echo "Extracting $HOME/Downloads/webi/$WEBI_PKG_FILE"
+ tar xf "$HOME/Downloads/webi/$WEBI_PKG_FILE"
elif [ "zip" == "$WEBI_EXT" ]; then
- echo "Extracting $HOME/Downloads/$WEBI_PKG_FILE"
- unzip "$HOME/Downloads/$WEBI_PKG_FILE" > __unzip__.log
+ echo "Extracting $HOME/Downloads/webi/$WEBI_PKG_FILE"
+ unzip "$HOME/Downloads/webi/$WEBI_PKG_FILE" > __unzip__.log
elif [ "exe" == "$WEBI_EXT" ]; then
- echo "Moving $HOME/Downloads/$WEBI_PKG_FILE"
- mv "$HOME/Downloads/$WEBI_PKG_FILE" .
+ echo "Moving $HOME/Downloads/webi/$WEBI_PKG_FILE"
+ mv "$HOME/Downloads/webi/$WEBI_PKG_FILE" .
elif [ "xz" == "$WEBI_EXT" ]; then
- echo "Inflating $HOME/Downloads/$WEBI_PKG_FILE"
- unxz -c "$HOME/Downloads/$WEBI_PKG_FILE" > "$(basename "$WEBI_PKG_FILE")"
+ echo "Inflating $HOME/Downloads/webi/$WEBI_PKG_FILE"
+ unxz -c "$HOME/Downloads/webi/$WEBI_PKG_FILE" > "$(basename "$WEBI_PKG_FILE")"
else
# do nothing
- echo "Failed to extract $HOME/Downloads/$WEBI_PKG_FILE"
+ echo "Failed to extract $HOME/Downloads/webi/$WEBI_PKG_FILE"
exit 1
fi
popd > /dev/null 2>&1