31d575c60f97f8df8b1a7f4f521c27aaef603329
[webi-installers/.git] / gitea / install.sh
1 set -e
2 set -u
3
4 pkg_cmd_name="gitea"
5
6 pkg_get_current_version() {
7     # 'gitea version' has output in this format:
8     #       v2.1.0 h1:pQSaIJGFluFvu8KDGDODV8u4/QRED/OPyIR+MWYYse8=
9     # This trims it down to just the version number:
10     #       2.0.0
11     echo "$(gitea --version 2>/dev/null | head -n 1 | cut -d' ' -f3)"
12 }
13
14 pkg_format_cmd_version() {
15     # 'gitea v2.1.0' is the canonical version format for gitea
16     my_version="$1"
17     echo "$pkg_cmd_name v$my_version"
18 }