refactor!: namespace downloads to ~/Downloads/webi on Mac and Linux
authorAJ ONeal <aj@therootcompany.com>
Sun, 15 Aug 2021 06:28:39 +0000 (06:28 +0000)
committerAJ ONeal <aj@therootcompany.com>
Mon, 15 Nov 2021 11:28:53 +0000 (11:28 +0000)
README.md
_webi/template.sh

index cb38b9123640add941a9dcf780331167f262dd4e..376623e462d43529322e40c49669c03e5d839f0b 100644 (file)
--- a/README.md
+++ b/README.md
@@ -244,7 +244,7 @@ WEBI_SINGLE=""
 
 ```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
index 01a9e3a4cec6e06f8debbaaf4001b34bbfa3d85a..4a15ec5057df76a5362c721d5ff2072911d35dec 100644 (file)
@@ -45,7 +45,7 @@ function __bootstrap_webi() {
     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"
 
@@ -150,7 +150,7 @@ function __bootstrap_webi() {
         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}"
@@ -200,20 +200,20 @@ function __bootstrap_webi() {
     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