install-lightbox2.sh 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/sh
  2. #
  3. # iPhoto2Atom, extract images from iPhoto™ libraries
  4. # Copyright (C) 2015-2016 Marcus Rohrmoser, http://purl.mro.name/iPhoto2Atom
  5. #
  6. # This program is free software: you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation, either version 3 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. #
  19. # Download and install http://lokeshdhakar.com/projects/lightbox2/
  20. #
  21. src="https://github.com/lokesh/lightbox2/archive/v2.8.2.zip"
  22. dst="assets/lightbox2"
  23. cd "$(dirname "$0")"
  24. zip=".tmp/lightbox2.zip"
  25. curl --location --create-dirs --remote-time --time-cond "${zip}" --output "${zip}" --url "${src}"
  26. rm -rf "${dst}"
  27. for d in css images js
  28. do
  29. mkdir -p "${dst}/${d}"
  30. unzip -jo "${zip}" */dist/"${d}"/*.* -d "${dst}/${d}"
  31. done
  32. echo "-------------------"
  33. find "${dst}" -name .DS_Store -exec rm "{}" \;
  34. find "${dst}" -type f \( -name *.js -or -name *.css \) -not -name *.min.* -exec rm "{}" \;
  35. find "${dst}" -type f -name *.map -or -name lightbox.min.js -exec rm "{}" \;
  36. rm -rf "$(dirname "${zip}")"
  37. find "${dst}" -type f