X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;f=gitea%2Finstall.sh;h=6a4d5868b930dbecadb6eedf7593df74c77b4c8a;hb=72406c4e0d438b76da054be8d5eff42d08312498;hp=31d575c60f97f8df8b1a7f4f521c27aaef603329;hpb=5e0debf4c54c1e55476c1bc533c26db2b54d2f77;p=webi-installers%2F.git diff --git a/gitea/install.sh b/gitea/install.sh index 31d575c..6a4d586 100644 --- a/gitea/install.sh +++ b/gitea/install.sh @@ -2,6 +2,8 @@ set -e set -u pkg_cmd_name="gitea" +pkg_src_cmd="$HOME/.local/opt/gitea-v$WEBI_VERSION/gitea" +pkg_dst_cmd="$HOME/.local/opt/gitea/gitea" pkg_get_current_version() { # 'gitea version' has output in this format: @@ -11,8 +13,23 @@ pkg_get_current_version() { echo "$(gitea --version 2>/dev/null | head -n 1 | cut -d' ' -f3)" } -pkg_format_cmd_version() { - # 'gitea v2.1.0' is the canonical version format for gitea - my_version="$1" - echo "$pkg_cmd_name v$my_version" +pkg_link() { + # although gitea is a single command it must be put in its own directory + # because it will always resolve its working path to its location, + # regardless of where it was started, where its config file lives, etc. + rm -rf "$pkg_dst_cmd" + mkdir -p "$pkg_dst_bin/custom" + chmod a+x "$pkg_src_cmd" + ln -s "$pkg_src_cmd" "$pkg_dst_cmd" +} + +# For installing from the extracted package tmp directory +pkg_install() { + # remove the versioned folder, just in case it's there with junk + rm -rf "$pkg_src_bin" + mkdir -p "$pkg_src_bin" + + # rename the entire extracted folder to the new location + # (this will be "$HOME/.local/opt/xmpl-v$WEBI_VERSION" by default) + mv ./"$pkg_cmd_name"* "$pkg_src_cmd" }