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.
 
 
 
 
 

40 line
1.0 KiB

  1. #!/bin/bash
  2. app_root_dir="diagrams"
  3. # NOTE: azure icon set is not latest version
  4. providers=("aws" "azure" "gcp")
  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
  27. for pvd in "${providers[@]}"; do
  28. echo "generating the modules 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