Skip to content

Commit 73a3b0f

Browse files
author
Vladimir Kotal
committed
print latest release if run with no args
1 parent 6eb8dd4 commit 73a3b0f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

dev/release.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,18 @@
88

99
set -e
1010

11-
if (( $# != 1 )); then
12-
echo "usage: `basename $0` <version>"
11+
if (( $# > 1 )); then
12+
echo "usage: `basename $0` [version]"
1313
exit 1
1414
fi
1515

16+
# Get the latest version (needs curl + jq).
17+
if (( $# == 0 )); then
18+
curl -s https://api.github.com/repos/oracle/opengrok/releases/latest | \
19+
jq .tag_name
20+
exit 0
21+
fi
22+
1623
VERSION=$1
1724

1825
if ! echo "$VERSION" | grep '^[0-9]\+\.[0-9]\+\.[0-9]\+$' >/dev/null; then

0 commit comments

Comments
 (0)