fonts.bash 831 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/bash
  2. _dir="${2-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)}"
  3. _target="${_dir%/*}" # deleted slash
  4. _dest="${_target%scripts}/dist/fonts/roboto/"
  5. # ==============================================================================
  6. # FUNCTIONS - START
  7. # ==============================================================================
  8. run_prepare() {
  9. install -d -m755 "${_dest}"
  10. }
  11. run_roboto()
  12. {
  13. local _name="${1-roboto-latin}"
  14. local _src="${_target%scripts}/src/fonts/roboto/${_name}.woff2" # input
  15. # copy font Roboto
  16. if [[ -n "${_src}" ]]; then
  17. cp -fv "${_src}" "${_dest}"
  18. fi
  19. }
  20. # ==============================================================================
  21. # EXECUTION - START
  22. # ==============================================================================
  23. run_prepare "$@"
  24. run_roboto "$@"