freeze-package-dhalls.sh 828 B

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/env bash
  2. set -euo pipefail
  3. ROOT_DIR=$(cd "$(dirname "$0")/.."; pwd -P)
  4. find "$ROOT_DIR/lib" -name '*.dhall' -print0 \
  5. | xargs -0 -n 1 dhall freeze --cache --all --inplace
  6. # The order is important because they depend on each other.
  7. # A tree would be ideal, but it is bash ¯\_(ツ)_/¯
  8. # TODO: Automatically figure this out
  9. package_files=(types/package.dhall
  10. defaults/package.dhall
  11. schemas/package.dhall
  12. extractors/package.dhall
  13. helpers/package.dhall
  14. render/optionals/lists/package.dhall
  15. render/optionals/package.dhall
  16. render/package.dhall
  17. package.dhall
  18. )
  19. for f in "${package_files[@]}"; do
  20. echo "Freezing $f"
  21. dhall freeze --cache --all --inplace "$ROOT_DIR/$f"
  22. done