js.sh 612 B

123456789101112131415161718192021222324
  1. #!/bin/bash
  2. #
  3. run_aplaylist()
  4. {
  5. local _name="${1-aplaylist}"
  6. local _dir="${2-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)}"
  7. local _target="${_dir%/*}" # deleted slash
  8. local _src="${_target%scripts}/src/js/${_name}.js" # input
  9. local _dest="${_target%scripts}/dist/js/" # output
  10. if [[ -n "${_src}" ]];
  11. then
  12. mkdir -p "${_dest}"
  13. cp -fv "${_src}" "${_dest}"
  14. fi
  15. }
  16. # ==============================================================================
  17. # EXECUTION - START
  18. # ==============================================================================
  19. run_aplaylist "$@"