Skip to content

Commit 497b0d6

Browse files
Matthias AltTobias Lückel
authored andcommitted
remove the shopware-version parameter from $@ because we don't want to pass it to docker-command
1 parent f47df88 commit 497b0d6

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

bin/sdTest.sh

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
#!/usr/bin/env bash
22

3-
SHOPWARE_VERSION=$1
3+
SHOPWARE_VERSION=$2
4+
5+
# Remove Shopware-Version from `$@`, so it is not passed to docker-compose command
6+
for arg do
7+
shift
8+
case $arg in
9+
(52|53|54|55) : ;;
10+
(*) set -- "$@" "$arg" ;;
11+
12+
esac
13+
done
14+
415

516
if [ -z "${SHOPWARE_VERSION}" ]; then
617
echo "You must provide the version of shopware you want to interact with, e.g. 54 for shopware 5.4"
@@ -31,7 +42,7 @@ fi
3142
export PROJECT_DIR="$( dirname $( dirname $( dirname "${PACKAGE_DIR}") ) )"
3243
export PACKAGE_DIR="${PACKAGE_DIR}"
3344
export PROJECT_NAME="$( basename ${PROJECT_DIR} | tr '[:upper:]' '[:lower:]' )"
34-
export DOCKER_COMPOSE_YAML=${PROJECT_DIR}"/etc/test/docker-compose.yml"
45+
export DOCKER_COMPOSE_YAML=${PROJECT_DIR}"/etc/test/docker-compose${SHOPWARE_VERSION}.yml"
3546

3647
if [ "$1" != "init" ]; then
3748
source ${PACKAGE_DIR}/etc/scripts/checkSdTestEnvironment.sh
@@ -71,7 +82,7 @@ function init_environment {
7182
cp ${PACKAGE_DIR}/README.md ${PROJECT_DIR}/README.TESTING.md
7283

7384
echo "Copying docker-compose.yml to be able to easily modify it for special needs"
74-
cp ${PACKAGE_DIR}/docker-compose${SHOPWARE_VERSION}.yml ${PROJECT_DIR}/etc/test/docker-compose.yml
85+
cp ${PACKAGE_DIR}/docker-compose${SHOPWARE_VERSION}.yml ${PROJECT_DIR}/etc/test/docker-compose${SHOPWARE_VERSION}.yml
7586

7687
echo "Copying config files to be able to easily modify it for special needs"
7788
cp ${PACKAGE_DIR}/php/* ${PROJECT_DIR}/etc/test/php
@@ -181,6 +192,6 @@ case "$1" in
181192
get_logs $@
182193
;;
183194
*)
184-
echo "usage: init/start/stop/run/restart/build/reset/remove/pull/logs"
195+
echo "usage: init/start/stop/run/restart/build/reset/remove/pull/logs <Shopware-Version, e.g. 54 for shopware 5.4>"
185196
;;
186197
esac

0 commit comments

Comments
 (0)