update variables _new_ => _src_, _common_ => _dst_,
[webi-installers/.git] / gitea / install.bash
index 17fc587d773f566faf11555346dd3d73e08985f2..43af834296d2df3a6c45f4caa9c1727987a06301 100644 (file)
@@ -1,20 +1,22 @@
 # title: Gitea
 # homepage: https://github.com/go-gitea/gitea
-# tagline: Fast, multi-platform web server with automatic HTTPS
+# tagline: Git with a cup of tea, painless self-hosted git service 
 # description: |
-# Caddy is an extensible server platform that uses TLS by default.
+#   `gitea` is a clean, lightweight self-hosted Github alternative, forked from Gogs. Lighter and more user-friendly than Gitlab.
 # examples: |
 #   ```bash
-#   gitea start
+#   gitea --version
 #   ```
 
 set -e
 set -u
 
-pkg_common_opt="$HOME/.local"
+pkg_cmd_name="gitea"
+pkg_dst="$HOME/.local"
 
-# just a junk file so that the version check always fails for non-current versions
-pkg_new_opt="$HOME/.local/opt/gitea-doesntexist111"
+# pkg_src isn't used in this script,
+# just setting a junk value for completeness (and possibly debug output)
+pkg_src="$HOME/Downloads/$WEBI_PKG_FILE"
 
 pkg_get_current_version() {
     # 'gitea version' has output in this format:
@@ -30,7 +32,7 @@ pkg_format_cmd_version() {
     echo "$pkg_cmd_name v$my_version"
 }
 
-pkg_link_new_version() {
+pkg_link_src_dst() {
     # gitea is just a single file, no directory linking to do
     true
 }
@@ -49,21 +51,22 @@ pkg_install() {
 
         # rename the entire extracted folder to the new location
         # (this will be "$HOME/.local/bin/gitea" by default)
-        mkdir -p "$pkg_common_bin"
-        mv ./"$pkg_cmd_name"* "$pkg_common_cmd"
+        mkdir -p "$pkg_dst_bin"
+        mv ./"$pkg_cmd_name"* "$pkg_dst_cmd"
+        chmod a+x "$pkg_dst_cmd"
 
     popd 2>&1 >/dev/null
 }
 
 pkg_post_install() {
     # just in case we add something in the future
-    pkg_link_new_version
+    pkg_link_src_dst
 
     # web_path_add is defined in webi/template.bash at https://github.com/webinstall/packages
     # Adds "$HOME/.local/bin" to PATH
-    webi_path_add "$pkg_common_bin"
+    webi_path_add "$pkg_dst_bin"
 }
 
 pkg_post_install_message() {
-    echo "Installed 'gitea' as $pkg_common_cmd"
+    echo "Installed 'gitea' v$WEBI_VERSION as $pkg_dst_cmd"
 }