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.

68 lines
1.7 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
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 "Creates a new project"
  7. echo
  8. echoSubTitle "Usage:"
  9. echo
  10. echo "create-project [customer] [project] [shortname]"
  11. echo
  12. echo "The given customer and project will result in the file directory as you have setted"
  13. echo "it in project_manager/etc/projects configuration file:"
  14. echo " - workspace_dir/customer/project"
  15. echo " - data_dir/customer/project"
  16. echo "It will set a configuration file for your project to:"
  17. echo " - data_dir/customer/project/etc/config"
  18. echo
  19. echo "--help Prints this message"
  20. echo " "
  21. }
  22. customer="$(getArgument "$1" "$(usage)")"
  23. project="$(getArgument "$2" "$(usage)")"
  24. shortname="$(getArgument "$3" "$(usage)")"
  25. has_project="$(hasProject "$project")"
  26. has_shortname="$(hasShortname "$shortname")"
  27. if [ "$has_project" == true ]
  28. then
  29. echoError "Project already exists"
  30. echo
  31. exit
  32. fi
  33. if [ "$has_shortname" == true ]
  34. then
  35. echoError "Shortname already exists"
  36. echo
  37. exit
  38. fi
  39. echo
  40. echoMainTitle "Create project"
  41. project_dir="$project_manager_dir/data/$customer/$project"
  42. workspace_dir="$project_manager_workspaces_dir/$customer/$project"
  43. echo
  44. echoSubTitle "Please verify data"
  45. echo
  46. echo "Project path: $workspace_dir"
  47. echo "Project data path: $project_dir"
  48. echo
  49. confirm
  50. makeProjectManagerDirectories "$shortname"
  51. makeWorkspaceDirectories "$shortname"
  52. configSet "project_manager.projects.$shortname.customer" "$customer"
  53. configSet "project_manager.projects.$shortname.project" "$project"
  54. runPostscripts "$shortname" "commands/create-project"
  55. echo
  56. echoSuccess "Project has been created, please configure $project_dir/etc"
  57. echo