2 # homepage: https://github.com/go-gitea/gitea
3 # tagline: Git with a cup of tea, painless self-hosted git service
5 # `gitea` is a clean, lightweight self-hosted Github alternative, forked from Gogs. Lighter and more user-friendly than Gitlab.
15 pkg_dst="$HOME/.local"
17 # pkg_src isn't used in this script,
18 # just setting a junk value for completeness (and possibly debug output)
19 pkg_src="$HOME/Downloads/$WEBI_PKG_FILE"
21 pkg_get_current_version() {
22 # 'gitea version' has output in this format:
23 # v2.1.0 h1:pQSaIJGFluFvu8KDGDODV8u4/QRED/OPyIR+MWYYse8=
24 # This trims it down to just the version number:
26 echo "$(gitea --version 2>/dev/null | head -n 1 | cut -d' ' -f3)"
29 pkg_format_cmd_version() {
30 # 'gitea v2.1.0' is the canonical version format for gitea
32 echo "$pkg_cmd_name v$my_version"
36 # gitea is just a single file, no directory linking to do
41 # if selected version is installed, quit
43 # will save to ~/Downloads/$WEBI_PKG_FILE by default
45 # supported formats (.xz, .tar.*, .zip) will be extracted to $WEBI_TMP
50 pushd "$WEBI_TMP" 2>&1 >/dev/null
52 # rename the entire extracted folder to the new location
53 # (this will be "$HOME/.local/bin/gitea" by default)
54 mkdir -p "$pkg_dst_bin"
55 mv ./"$pkg_cmd_name"* "$pkg_dst_cmd"
56 chmod a+x "$pkg_dst_cmd"
62 # just in case we add something in the future
65 # web_path_add is defined in webi/template.bash at https://github.com/webinstall/packages
66 # Adds "$HOME/.local/bin" to PATH
67 webi_path_add "$pkg_dst_bin"
70 pkg_post_install_message() {
71 echo "Installed 'gitea' v$WEBI_VERSION as $pkg_dst_cmd"