fetch-noto-fonts 933 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. set -e
  3. REPO_DIR="$(mktemp -d)"
  4. OUT_DIR="[% dest_dir %]/noto-fonts-[% c("var/noto_git_hash") %]-[% c("version") %]"
  5. pushd "$REPO_DIR"
  6. git init
  7. git remote add origin https://github.com/googlefonts/noto-fonts.git
  8. git fetch --depth 1 origin "[% c('var/noto_git_hash') %]"
  9. git checkout "[% c('var/noto_git_hash') %]"
  10. rm -rf "$OUT_DIR"
  11. mkdir "$OUT_DIR"
  12. [%
  13. platforms = [c("var/noto_fonts_common"), c("var/noto_fonts_linux"), c("var/noto_fonts_mac"), c("var/noto_fonts_windows")];
  14. FOREACH platform = platforms;
  15. FOREACH fontfile = platform;
  16. GET 'font=$(find hinted -name ' _ fontfile _ ' -print | head -1)' _ "\n";
  17. # Do not use find -exec, because if the file does not exist, we have an
  18. # error only in the following phases. In this way, we try to fail earlier.
  19. GET 'cp -u $font "$OUT_DIR/"' _ "\n";
  20. END;
  21. END; %]
  22. popd
  23. rm -rf "$REPO_DIR"
  24. echo "Finished downloading the needed Noto fonts"