Skip to content

Commit

Permalink
Fix astyle version check for macOS
Browse files Browse the repository at this point in the history
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 4bdfaa5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/astyle.sh
Expand Up @@ -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
Expand Down

0 comments on commit 4bdfaa5

Please sign in to comment.