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