Skip to content

Commit 41b6ae6

Browse files
committedApr 24, 2018
fix astyle version check
(cherry picked from commit dee284f)
1 parent 120d5b1 commit 41b6ae6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎scripts/astyle.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fi
2222

2323
min_version="3"
2424
astyle_version_check() {
25-
[ `printf "$($1 --version | cut -d ' ' -f4)\n$min_version" | sort -${SV} | head -n1` = "$min_version" ]
25+
[ `printf "$($1 --version 2>&1 | cut -d ' ' -f4)\n$min_version" | sort -${SV} | head -n1` = "$min_version" ]
2626
}
2727

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

1 commit comments

Comments
 (1)

domi4484 commented on Feb 3, 2021

@domi4484
Contributor

Hallo @jef-n, on my system astyle is complaining that he can't set the correct locale and always print some lines to stderr. Nothing important but because the sterr get redirected to stdout the version check does not work correctly in my case.
Why is this redirect needed?
If the redirect is still needed I would add something like "| tail -n 1 |" to keep only last line which actually contains the version. But I am not sure if it could broke something?
[ $(printf "$($1 --version 2>&1 | tail -n 1 | cut -d ' ' -f4)\\n$min_version" | sort -${SV} | head -n1) = "$min_version" ]

Please sign in to comment.