File tree Expand file tree Collapse file tree 1 file changed +20
-9
lines changed
Expand file tree Collapse file tree 1 file changed +20
-9
lines changed Original file line number Diff line number Diff line change @@ -129,20 +129,22 @@ unittests="on"
129129swiftlint=" on"
130130tailor=" on"
131131lizard=" on"
132+ sonarscanner=" "
132133
133134while [ $# -gt 0 ]
134135do
135136 case " $1 " in
136137 -v) vflag=on;;
137138 -n) nflag=on;;
138139 -nounittests) unittests=" " ;;
139- -noswiftlint) swiftlint=" " ;;
140- -notailor) tailor=" " ;;
141- --) shift ; break ;;
142- -* )
140+ -noswiftlint) swiftlint=" " ;;
141+ -notailor) tailor=" " ;;
142+ -usesonarscanner) sonarscanner=" on" ;;
143+ --) shift ; break ;;
144+ -* )
143145 echo >&2 " Usage: $0 [-v]"
144146 exit 1;;
145- * ) break ;; # terminate while loop
147+ * ) break ;; # terminate while loop
146148 esac
147149 shift
148150done
@@ -368,11 +370,20 @@ else
368370fi
369371
370372# SonarQube
371- echo -n ' Running SonarQube using SonarQube Runner'
372- if hash /dev/stdout sonar-runner 2> /dev/null; then
373- runCommand /dev/stdout sonar-runner
373+ if [ " $sonarscanner " = " on" ]; then
374+ echo -n ' Running SonarQube using SonarQube Scanner'
375+ if hash /dev/stdout sonar-scanner 2> /dev/null; then
376+ runCommand /dev/stdout sonar-scanner
377+ else
378+ echo ' Skipping sonar-scanner (not installed!)'
379+ fi
374380else
375- runCommand /dev/stdout sonar-scanner
381+ echo -n ' Running SonarQube using SonarQube Runner'
382+ if hash /dev/stdout sonar-runner 2> /dev/null; then
383+ runCommand /dev/stdout sonar-runner
384+ else
385+ runCommand /dev/stdout sonar-scanner
386+ fi
376387fi
377388
378389# Kill progress indicator
You can’t perform that action at this time.
0 commit comments