]>
jfr.im git - irc/weechat/weechat.git/blob - version.sh
3 # Copyright (C) 2015-2020 Sébastien Helleu <flashcode@flashtux.org>
5 # This file is part of WeeChat, the extensible chat client.
7 # WeeChat is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
12 # WeeChat is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with WeeChat. If not, see <https://www.gnu.org/licenses/>.
22 # Returns current stable or devel version of WeeChat.
25 # version.sh stable|devel|devel-full|devel-major|devel-minor|devel-patch
27 # stable the current stable (e.g. 1.3)
28 # devel the current devel (e.g. 1.4)
29 # devel-full the full name of devel (e.g. 1.4-dev or 1.4-rc1)
30 # devel-major the major version of devel (e.g. 1)
31 # devel-minor the minor version of devel (e.g. 4-dev)
32 # devel-patch the patch version of devel (e.g. 2 for version 1.4.2)
37 WEECHAT_DEVEL_FULL
=3.0.2-dev
40 echo >&2 "Syntax: $0 stable|devel|devel-full|devel-major|devel-minor|devel-patch"
45 stable
) echo $WEECHAT_STABLE ;;
46 devel
) echo $WEECHAT_DEVEL ;;
47 devel
-full ) echo $WEECHAT_DEVEL_FULL ;;
48 devel
-major ) echo $WEECHAT_DEVEL_FULL | cut
-d'.' -f1 ;;
49 devel
-minor ) echo $WEECHAT_DEVEL_FULL | cut
-d'.' -f2 ;;
50 devel
-patch ) echo $WEECHAT_DEVEL_FULL | cut
-d'.' -f3- ;;
51 * ) echo >&2 "ERROR: unknown version."