Responsive PhotoSwipe image gallery for After Dark https://after-dark.habd.as/module/hall-of-mirrors
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.

copy 801B

12345678910111213141516171819202122232425262728
  1. #!/bin/bash
  2. set -e
  3. ASSETS_DIR=node_modules/photoswipe/dist
  4. TARGET_DIR=static/modules/hall-of-mirrors
  5. # Print error to stdout and exit 1 if asset directories cannot be found
  6. if ! [ -d "$ASSETS_DIR" ] || [ -d "$ASSETS_DIR"/default-skins ] ; then
  7. echo "Error: Photoswipe assets not found in $PWD/$ASSETS_DIR." >&2; exit 1
  8. fi
  9. # Create target directory if not exists
  10. mkdir -p "$TARGET_DIR"
  11. # Define required assets
  12. # See https://stackoverflow.com/a/51683629/712334 for recursive globbing
  13. files=(
  14. "$ASSETS_DIR"/*.min.js
  15. "$ASSETS_DIR"/*.css
  16. "$ASSETS_DIR"/**/*
  17. )
  18. # printf '%s\n' "${files[@]}" # e.g. path/to/source/filename.tar.gz
  19. # printf '%s\n' "${files[@]##*/}" # e.g. filename.tgz
  20. # Copy required assets to target directory
  21. for file in "${files[@]}" ; do
  22. cp "$file" "$TARGET_DIR"
  23. done