Skip to content

Commit 4bdfaa5

Browse files
committedNov 10, 2017
Fix astyle version check for macOS
Hard to emulate natural version sorting on macOS. Just use numeric. https://stackoverflow.com/questions/21394536
1 parent abe5756 commit 4bdfaa5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
 

‎scripts/astyle.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,15 @@
1414
# #
1515
###########################################################################
1616

17+
# sort by version option
18+
SV=V
19+
if [[ "$OSTYPE" =~ darwin* ]]; then
20+
SV=n
21+
fi
22+
1723
min_version="3"
1824
astyle_version_check() {
19-
[ `printf "$($1 --version | cut -d ' ' -f4)\n$min_version" | sort -V | head -n1` = "$min_version" ]
25+
[ `printf "$($1 --version | cut -d ' ' -f4)\n$min_version" | sort -${SV} | head -n1` = "$min_version" ]
2026
}
2127

2228
for ASTYLE in ${QGISSTYLE} $(dirname $0)/qgisstyle $(dirname $0)/RelWithDebInfo/qgisstyle astyle

0 commit comments

Comments
 (0)
Please sign in to comment.