From b96b468d7a3653cdd06d076b6669a8a3008f7e5a Mon Sep 17 00:00:00 2001 From: Thomas Jarosch Date: Thu, 18 Dec 2014 15:58:17 +0100 Subject: [PATCH] runastyle: Move astyle binary name into a variable So it's easy to adjust the path to the exact used astyle version of cppcheck. --- runastyle | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/runastyle b/runastyle index b52a8fffe..c25a305e0 100755 --- a/runastyle +++ b/runastyle @@ -7,8 +7,9 @@ # If project management wishes to take a newer astyle version into use # just change this string to match the start of astyle version string. ASTYLE_VERSION="Artistic Style Version 2.03" +ASTYLE="astyle" -if [[ "`astyle --version 2>&1`" != ${ASTYLE_VERSION}* ]]; then +if [[ "`$ASTYLE --version 2>&1`" != ${ASTYLE_VERSION}* ]]; then echo "You should use: ${ASTYLE_VERSION}"; exit 1; fi @@ -16,21 +17,21 @@ fi style="--style=stroustrup --indent=spaces=4 --indent-namespaces --lineend=linux --min-conditional-indent=0" options="--options=none --pad-header --unpad-paren --suffix=none --convert-tabs" -astyle $style $options cli/*.cpp -astyle $style $options cli/*.h -astyle $style $options democlient/*.cpp -astyle $style $options gui/*.cpp -astyle $style $options gui/*.h -astyle $style $options -r gui/test/*.cpp -astyle $style $options -r gui/test/*.h -astyle $style $options lib/*.cpp -astyle $style $options lib/*.h -astyle $style $options test/*.cpp -astyle $style $options test/*.h +$ASTYLE $style $options cli/*.cpp +$ASTYLE $style $options cli/*.h +$ASTYLE $style $options democlient/*.cpp +$ASTYLE $style $options gui/*.cpp +$ASTYLE $style $options gui/*.h +$ASTYLE $style $options -r gui/test/*.cpp +$ASTYLE $style $options -r gui/test/*.h +$ASTYLE $style $options lib/*.cpp +$ASTYLE $style $options lib/*.h +$ASTYLE $style $options test/*.cpp +$ASTYLE $style $options test/*.h -astyle $style $options tools/*.cpp -astyle $style $options --recursive "samples/*.c" -astyle $style $options --recursive "samples/*.cpp" +$ASTYLE $style $options tools/*.cpp +$ASTYLE $style $options --recursive "samples/*.c" +$ASTYLE $style $options --recursive "samples/*.cpp" # Convert tabs to spaces.. even in strings # sed -i "s/\t/ /g" test/test*.cpp