Skip to content
Permalink
Browse files

Fix astyle version check for macOS

Hard to emulate natural version sorting on macOS. Just use numeric.
https://stackoverflow.com/questions/21394536
  • Loading branch information
dakcarto committed Nov 10, 2017
1 parent abe5756 commit 4bdfaa5f9532fdcd18fae3e9c5283f7fffe0c038
Showing with 7 additions and 1 deletion.
  1. +7 −1 scripts/astyle.sh
@@ -14,9 +14,15 @@
# #
###########################################################################

# sort by version option
SV=V
if [[ "$OSTYPE" =~ darwin* ]]; then
SV=n
fi

min_version="3"
astyle_version_check() {
[ `printf "$($1 --version | cut -d ' ' -f4)\n$min_version" | sort -V | head -n1` = "$min_version" ]
[ `printf "$($1 --version | cut -d ' ' -f4)\n$min_version" | sort -${SV} | head -n1` = "$min_version" ]
}

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

0 comments on commit 4bdfaa5

Please sign in to comment.
You can’t perform that action at this time.