Skip to content

Commit c5e7b7b

Browse files
committed
sj-version.sh: use ./pom.xml to extract version
If no argument is given, it makes sense to check for a ./pom.xml file with a pom-scijava parent and use its version as the version.
1 parent 0b03f68 commit c5e7b7b

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

sj-version.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@ props() {
2020
sort
2121
}
2222

23+
if [ -z "$version" ]
24+
then
25+
# try to extract version from pom.xml in this directory
26+
if [ -e pom.xml ]
27+
then
28+
version=$(grep -A 1 pom-scijava pom.xml | \
29+
grep '<version>' | \
30+
sed 's/<\/.*//' | \
31+
sed 's/.*>//')
32+
fi
33+
fi
34+
2335
if [ -z "$version" ]
2436
then
2537
echo "Usage: sj-version.sh version [version-to-diff]"

0 commit comments

Comments
 (0)