Copilot commented on code in PR #2113:
URL:
https://github.com/apache/incubator-kie-kogito-examples/pull/2113#discussion_r2174705160
##########
kogito-quarkus-examples/process-instance-migration-quarkus/docker-compose/startServices.sh:
##########
@@ -8,15 +8,15 @@ PROJECT_VERSION=$(cd ../ && mvn help:evaluate
-Dexpression=project.version -q -D
echo "Project version: ${PROJECT_VERSION}"
-if [[ $PROJECT_VERSION == *SNAPSHOT ]];
-then
- KOGITO_VERSION="latest"
-else
- KOGITO_VERSION=${PROJECT_VERSION%.*}
-fi
+case $PROJECT_VERSION in
+ *SNAPSHOT)
+ KOGITO_VERSION="main" ;;
+ *)
+ KOGITO_VERSION=${PROJECT_VERSION%.*} ;;
+esac
if [ -n "$1" ]; then
- if [[ ("$1" == "infra") || ("$1" == "example")]];
+ if [ $1 = "infra" -o $1 = "example" ];
Review Comment:
Consider quoting $1 in the test expression to prevent potential
word-splitting issues when the argument is empty or contains spaces. For
example: if [ "$1" = "infra" -o "$1" = "example" ];
```suggestion
if [ "$1" = "infra" -o "$1" = "example" ];
```
##########
kogito-quarkus-examples/kogito-travel-agency/extended/docker-compose/startServices.sh:
##########
@@ -24,19 +24,19 @@ PROJECT_VERSION=$(cd ../ && mvn help:evaluate
-Dexpression=project.version -q -D
echo "Project version: ${PROJECT_VERSION}"
-if [[ $PROJECT_VERSION == *SNAPSHOT ]];
-then
- KOGITO_VERSION="latest"
-else
- KOGITO_VERSION=${PROJECT_VERSION%.*}
-fi
+case $PROJECT_VERSION in
+ *SNAPSHOT)
+ KOGITO_VERSION="main" ;;
+ *)
+ KOGITO_VERSION=${PROJECT_VERSION%.*} ;;
+esac
echo "Kogito Image version: ${KOGITO_VERSION}"
echo "KOGITO_VERSION=${KOGITO_VERSION}" > ".env"
-if [ "$(uname)" == "Darwin" ]; then
+if [ $(uname) = "Darwin" ]; then
echo "DOCKER_GATEWAY_HOST=kubernetes.docker.internal" >> ".env"
-elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
+elif [ "$(expr substr $(uname -s) 1 5)" = "Linux" ]; then
Review Comment:
Quote the output of $(uname) to ensure accurate string comparison. For
example: if [ "$(uname)" = "Darwin" ]; then
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]