You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1006 B
33 lines
1006 B
#!/bin/bash
|
|
|
|
### DO NOT EDIT THIS FILE
|
|
|
|
source "$(dirname "${BASH_SOURCE[0]}")/../includes/includes.sh"
|
|
app_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." &> /dev/null && pwd)
|
|
source "$app_dir/etc/config.sh"
|
|
|
|
env=$(getArgument "$1" "Usage: switch_system.sh [live|stage] [true|false: UpdateDatabase]" "live stage")
|
|
update_database_flag=$(getArgument "$2" "Usage: switch_system.sh [live|stage] [true|false: UpdateDatabase]" "true false")
|
|
|
|
echoMainTitle "Switch to local_$env System"
|
|
|
|
shopware_check_install="$app_dir/git/$project_name$git_shopware_path/src"
|
|
if [ ! -d "$shopware_check_install" ]
|
|
then
|
|
echo
|
|
echoError "No Shopware installed, try bin/commands/install_shopware.sh"
|
|
exit
|
|
fi
|
|
|
|
if [ "$update_database_flag" == true ]
|
|
then
|
|
"$app_dir/bin/commands/import_db.sh" "$env"
|
|
"$app_dir/bin/commands/create_local_env.sh" "local_$env"
|
|
"$app_dir/bin/commands/make_local_database.sh" "$env"
|
|
fi
|
|
|
|
for path in "${import_media_files[@]}"
|
|
do
|
|
"$app_dir/bin/commands/import_media.sh" "$env" "$path"
|
|
done
|
|
|