mostly update comments, fix gitea releases.js
[webi-installers/.git] / caddy / install.bash
index 05366cd45534fa1c529b81a923c01c5e6ee53445..75521b3e9a4bbc965282f8b6ec097609618f6aab 100644 (file)
@@ -2,7 +2,7 @@
 # homepage: https://github.com/caddyserver/caddy
 # tagline: Fast, multi-platform web server with automatic HTTPS
 # description: |
-# Caddy is an extensible server platform that uses TLS by default.
+#   Caddy is an extensible server platform that uses TLS by default.
 # examples: |
 #   ```bash
 #   caddy start
@@ -22,11 +22,11 @@ pkg_get_current_version() {
     #       v2.1.0 h1:pQSaIJGFluFvu8KDGDODV8u4/QRED/OPyIR+MWYYse8=
     # This trims it down to just the version number:
     #       2.0.0
-    echo "$(caddy version 2>/dev/null | head -n 1 | cut -d ' ' -f1 | sed 's:^v::')"
+    echo "$(caddy version 2>/dev/null | head -n 1 | cut -d' ' -f1 | sed 's:^v::')"
 }
 
 pkg_format_cmd_version() {
-    # 'node v12.8.0' is the canonical version format for node
+    # 'caddy v2.1.0' is the canonical version format for caddy
     my_version="$1"
     echo "$pkg_cmd_name v$my_version"
 }
@@ -48,11 +48,21 @@ pkg_pre_install() {
 pkg_install() {
     pushd "$WEBI_TMP" 2>&1 >/dev/null
 
-        # rename the entire extracted folder to the new location
-        # (this will be "$HOME/.local/opt/node-v$WEBI_VERSION" by default)
+        # ensure the bin dir exists
         mkdir -p "$pkg_common_bin"
+
+        # rename the entire extracted folder to the new location
+        # (this will be "$HOME/.local/bin/caddy", as set above)
+
+        # ex (full directory): ./node-v13-linux-amd64/bin/node.exe
+        #mv ./"$pkg_cmd_name"* "$pkg_new_opt"
+
+        # ex (single file): ./caddy-v2.0.0-linux-amd64.exe
         mv ./"$pkg_cmd_name"* "$pkg_common_cmd"
 
+        # ex (single file, nested in directory): ./rg/rg-v13-linux-amd64
+        #mv ./"$pkg_cmd_name"*/"$pkg_cmd_name"* "$pkg_commend_cmd"
+
     popd 2>&1 >/dev/null
 }
 
@@ -61,6 +71,6 @@ pkg_post_install() {
     pkg_link_new_version
 
     # web_path_add is defined in webi/template.bash at https://github.com/webinstall/packages
-    # Adds "$HOME/.local/opt/node" to PATH
+    # Adds "$HOME/.local/bin" to PATH
     webi_path_add "$pkg_common_bin"
 }