Ein für Shopware 6 vorbereitet Systemmanagment.
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

2 years ago
  1. #!/bin/bash
  2. ### DO NOT EDIT THIS FILE
  3. source "$(dirname "${BASH_SOURCE[0]}")/../includes/includes.sh"
  4. app_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." &> /dev/null && pwd)
  5. source "$app_dir/etc/config.sh"
  6. env=$(getArgument "$1" "Usage: switch_system.sh [live|stage] [true|false: UpdateDatabase]" "live stage")
  7. update_database_flag=$(getArgument "$2" "Usage: switch_system.sh [live|stage] [true|false: UpdateDatabase]" "true false")
  8. echoMainTitle "Switch to local_$env System"
  9. shopware_check_install="$app_dir/git/$project_name$git_shopware_path/src"
  10. if [ ! -d "$shopware_check_install" ]
  11. then
  12. echo
  13. echoError "No Shopware installed, try bin/commands/install_shopware.sh"
  14. exit
  15. fi
  16. if [ "$update_database_flag" == true ]
  17. then
  18. "$app_dir/bin/commands/import_db.sh" "$env"
  19. "$app_dir/bin/commands/create_local_env.sh" "local_$env"
  20. "$app_dir/bin/commands/make_local_database.sh" "$env"
  21. fi
  22. for path in "${import_media_files[@]}"
  23. do
  24. "$app_dir/bin/commands/import_media.sh" "$env" "$path"
  25. done