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.

58 lines
1.5 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. #!/bin/bash
  2. ### DO NOT EDIT THIS FILE
  3. source "$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." &> /dev/null && pwd)/includes/bash_header"
  4. function usage {
  5. echo
  6. echoMainTitle "Removes a project"
  7. echo
  8. echoSubTitle "Usage:"
  9. echo
  10. echo "remove-project [shortname]"
  11. echo
  12. echo "This will remove the project and move the project files to ./.trash"
  13. echo
  14. echo "--help Prints this message"
  15. echo
  16. }
  17. shortname="$(getArgument "$1" "$(usage)" true)"
  18. customer="$(getCustomerFromShortname "$shortname")"
  19. project="$(getProjectFromShortname "$shortname")"
  20. pos="$(getProjectConfigPosition "$shortname")"
  21. workspace_dir="$project_manager_workspaces_dir/$customer/$project"
  22. project_dir="$project_manager_dir/data/$customer/$project"
  23. echo
  24. echoMainTitle "Remove project"
  25. echo
  26. echoSubTitle "Please verify data"
  27. echo
  28. echo "Project Path: $workspace_dir"
  29. echo "Project Data Path: $project_dir"
  30. echo
  31. confirm
  32. echo
  33. echo "Moving files to trash"
  34. rand=$(cat /proc/sys/kernel/random/uuid)
  35. trash_path="$project_manager_dir/.trash/$rand"
  36. mkdir "$trash_path"
  37. mkdir "$trash_path/data"
  38. mkdir "$trash_path/workspace"
  39. mkdir "$trash_path/data/$customer"
  40. mkdir "$trash_path/workspace/$customer"
  41. mv "$project_dir" "$trash_path/data/$customer/$project"
  42. mv "$workspace_dir" "$trash_path/workspace/$customer/$project"
  43. removeProjectConfig "$shortname"
  44. runPostscripts "$shortname" "commands/remove-project"
  45. postScript "$trash_path/data/bin/postscripts/commands/remove-project"
  46. echo
  47. echoSuccess "Project has been removed"
  48. echo