Skip to content

Commit c2c6492

Browse files
committed
-remove bug on ROOT_PROJECT, ths bug was stopping the script to run when ROOT_PROJECT was not declared
- On build function set the different seeds for magento 1 or 2
1 parent d747fd5 commit c2c6492

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

bin/console.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# of the current script (e.g. "server")
88
SCRIPTNAME="bin/$(basename $0)"
99

10+
1011
# CONFIGFOLDER contains the path
1112
# to the config folder.
1213
CONFIGFOLDER="$(pwd)/config"
@@ -37,10 +38,8 @@ fi
3738

3839
if [ -z "$ROOT_PROJECT" ]; then
3940
ROOT_PROJECT=$(pwd)
40-
exit 1
4141
fi
4242

43-
# check the environment variables
4443
if [ -z "$DATABASE_NAME" ]; then
4544
echo >&2 "The DATABASE_NAME variable is not set"
4645
exit 1
@@ -309,9 +308,17 @@ installMagento() {
309308
# None
310309
#######################################
311310
build() {
311+
case "$2" in
312+
mage1)
313+
sed "s|\$MAGE_DOMAIN|$MAGE_DOMAIN|g; s|\$WEB_USER|$WEB_USER|g; s|\$PUBLIC_DIR|$PUBLIC_DIR|g" "$CONFIGFOLDER/nginx/templates/sites-enabled/unsecureMage1.conf.template" >"$CONFIGFOLDER/nginx/sites-enabled/default.conf"
314+
;;
315+
*)
316+
sed "s|\$MAGE_DOMAIN|$MAGE_DOMAIN|g; s|\$WEB_USER|$WEB_USER|g" "$CONFIGFOLDER/nginx/templates/sites-enabled/unsecure.conf.template" >"$CONFIGFOLDER/nginx/sites-enabled/default.conf"
317+
;;
318+
esac
319+
312320
sed "s|\$WEB_USER|$WEB_USER|g" "$CONFIGFOLDER/nginx/templates/nginx.conf.template" >"$CONFIGFOLDER/nginx/nginx.conf"
313321
sed "s|\$WEB_USER|$WEB_USER|g" "$CONFIGFOLDER/php/zz-docker.conf.template" >"$CONFIGFOLDER/php/zz-docker.conf"
314-
sed "s|\$MAGE_DOMAIN|$MAGE_DOMAIN|g; s|\$WEB_USER|$WEB_USER|g" "$CONFIGFOLDER/nginx/templates/sites-enabled/unsecure.conf.template" >"$CONFIGFOLDER/nginx/sites-enabled/default.conf"
315322

316323
stop
317324
ROOT_PROJECT=$ROOT_PROJECT docker-compose -f ${DOCKERCOMPOSEFILE} up -d --build
@@ -503,7 +510,7 @@ status)
503510
status
504511
;;
505512
rebuild)
506-
build
513+
build $*
507514
;;
508515
*)
509516
usage

0 commit comments

Comments
 (0)