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.

49 lines
913 B

  1. #!/bin/bash
  2. source "$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." &> /dev/null && pwd)/etc/config"
  3. source "$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." &> /dev/null && pwd)/etc/projects"
  4. function usage {
  5. echo
  6. echoMainTitle "List all projects"
  7. echo
  8. echoSubTitle "Usage:"
  9. echo
  10. echo "list-projects"
  11. echo
  12. echo "--help Prints this message"
  13. echo
  14. }
  15. function listProjects {
  16. echo >&2
  17. echoSubTitle "Projects list" >&2
  18. echo >&2
  19. for i in "${!projects[@]}"
  20. do
  21. echo "- Shortname: ${shortnames[$i]}
  22. Customer: ${customers[$i]}
  23. Project: ${projects[$i]}" >&2
  24. echo
  25. done
  26. }
  27. echo
  28. echoMainTitle "Listing projects"
  29. help="$(getParameter "--help" false "$*")"
  30. if [ "$help" == true ]
  31. then
  32. usage
  33. exit
  34. else
  35. if [ "${#projects[@]}" -eq 0 ]
  36. then
  37. echo
  38. echo "There are currently no projects setted up"
  39. echo
  40. else
  41. listProjects
  42. fi
  43. fi
  44. echoSuccess "Listing done"