Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

autogen.sh 1.0 KiB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/bash
  2. app_root_dir="diagrams"
  3. # NOTE: azure icon set is not latest version
  4. providers=("aws" "azure" "gcp" "k8s")
  5. if ! [ -x "$(command -v round)" ]; then
  6. echo 'round is not installed'
  7. fi
  8. if ! [ -x "$(command -v inkscape)" ]; then
  9. echo 'inkscape is not installed'
  10. fi
  11. # preprocess the resources
  12. for pvd in "${providers[@]}"; do
  13. # convert the svg to png for azure provider
  14. if [ "$pvd" = "azure" ]; then
  15. echo "converting the svg to png for provider '$pvd'"
  16. python -m scripts.resource svg2png "$pvd"
  17. fi
  18. echo "cleaning the resource names for provider '$pvd'"
  19. python -m scripts.resource clean "$pvd"
  20. # round the all png images for aws provider
  21. if [ "$pvd" = "aws" ]; then
  22. echo "rounding the resources for provider '$pvd'"
  23. python -m scripts.resource round "$pvd"
  24. fi
  25. done
  26. # generate the module classes and docs
  27. for pvd in "${providers[@]}"; do
  28. echo "generating the modules & docs for provider '$pvd'"
  29. python -m scripts.generate "$pvd"
  30. done
  31. # run black
  32. echo "linting the all the diagram modules"
  33. black "$app_root_dir"/**/*.py