Skip to content

Commit 2765251

Browse files
committed
change log output
1 parent afb6f79 commit 2765251

2 files changed

Lines changed: 16 additions & 14 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ docker run --rm --name codeql-agent-docker \
137137
-v "$PWD/codeql-agent-results:/opt/results" \
138138
-e "LANGUAGE=java" \
139139
-e "JAVA_VERSION=8" \
140-
-e "COMMAND='mvn clean install'" \
140+
-e "COMMAND=mvn clean install" \
141141
doublevkay/codeql-agent-dev
142142
143143
```

scripts/analyze.sh

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ else
2828
fi
2929

3030
if [ ! -d "$SRC" ]; then
31-
print_red "Error: ${SRC} not found. Can not continue."
31+
print_red "[Error]: ${SRC} not found. Can not continue."
3232
exit 3
3333
fi
3434

@@ -92,17 +92,7 @@ then
9292
THREADS="0"
9393
fi
9494

95-
# Switch to Java 8
96-
if [[ $JAVA_VERSION ]]
97-
then
98-
if [[ $JAVA_VERSION == "8" ]]; then
99-
update-java-alternatives -s $(update-java-alternatives -l | grep 8 | cut -d " " -f1) || echo '.'
100-
elif [[ $JAVA_VERSION == "11" ]]; then
101-
update-java-alternatives -s $(update-java-alternatives -l | grep 11 | cut -d " " -f1) || echo '.'
102-
fi
103-
else
104-
echo "Error: JAVA_VERSION must be 8 or 11."
105-
fi
95+
10696

10797
DB="$OUTPUT/codeql-db"
10898

@@ -118,6 +108,18 @@ print_green " [+] Output: $OUTPUT"
118108
print_green " [+] Format: $FORMAT"
119109
echo "----------------"
120110

111+
# Switch to Java 8
112+
if [[ $JAVA_VERSION ]]
113+
then
114+
if [[ $JAVA_VERSION == "8" ]]; then
115+
update-java-alternatives -s $(update-java-alternatives -l | grep 8 | cut -d " " -f1) || echo '.'
116+
elif [[ $JAVA_VERSION == "11" ]]; then
117+
update-java-alternatives -s $(update-java-alternatives -l | grep 11 | cut -d " " -f1) || echo '.'
118+
else
119+
echo "[Warning] : JAVA_VERSION must be 8 or 11."
120+
fi
121+
fi
122+
121123
# Check action
122124
if [ -z $ACTION ]
123125
then
@@ -135,7 +137,7 @@ create_database() {
135137
codeql database create --threads=$THREADS --language=$LANGUAGE $DB -s $SRC $OVERWRITE_FLAG
136138
fi
137139
if [[ $? -ne 0 && $? -ne 2 ]]; then # ignore unempty database
138-
print_red "Error: Codeql create database failed."
140+
print_red "[Error]: Codeql create database failed."
139141
finalize
140142
exit 6
141143
fi

0 commit comments

Comments
 (0)