install-web-files.fish 515 B

123456789101112131415161718192021222324252627282930
  1. #!/usr/bin/fish
  2. # Aim at deploying on local httpd server
  3. set fish_trace 1
  4. # Check existence of deployment target
  5. if not set -q WEBLAND_WEB_DEPLOY_PATH
  6. exit 1
  7. end
  8. set destinationPath $WEBLAND_WEB_DEPLOY_PATH
  9. if not test -e $destinationPath
  10. exit 2
  11. end
  12. # Check existence of source
  13. if not set gitTopLevel (git rev-parse --show-toplevel)
  14. exit 3
  15. end
  16. set sourcePath $gitTopLevel/web/
  17. if not test -e $sourcePath
  18. exit 4
  19. end
  20. # Deploy
  21. rsync --recursive --verbose --delete-after $sourcePath $destinationPath
  22. exit 0