5 pkg_src_cmd="$HOME/.local/opt/gitea-v$WEBI_VERSION/gitea"
6 pkg_dst_cmd="$HOME/.local/opt/gitea/gitea"
8 pkg_get_current_version() {
9 # 'gitea version' has output in this format:
10 # v2.1.0 h1:pQSaIJGFluFvu8KDGDODV8u4/QRED/OPyIR+MWYYse8=
11 # This trims it down to just the version number:
13 echo "$(gitea --version 2>/dev/null | head -n 1 | cut -d' ' -f3)"
17 # although gitea is a single command it must be put in its own directory
18 # because it will always resolve its working path to its location,
19 # regardless of where it was started, where its config file lives, etc.
21 mkdir -p "$pkg_dst_bin/custom"
22 chmod a+x "$pkg_src_cmd"
23 ln -s "$pkg_src_cmd" "$pkg_dst_cmd"
26 # For installing from the extracted package tmp directory
28 # remove the versioned folder, just in case it's there with junk
30 mkdir -p "$pkg_src_bin"
32 # rename the entire extracted folder to the new location
33 # (this will be "$HOME/.local/opt/xmpl-v$WEBI_VERSION" by default)
34 mv ./"$pkg_cmd_name"* "$pkg_src_cmd"