Guest User

Untitled

a guest
Jun 18th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #!/bin/sh
  2. #
  3. # for each file in site/public/ dir, link it to the main /public dir so it can be edited directly.
  4. #
  5. # This script should be run AFTER the server is started, not before.
  6. #
  7. #
  8. for FILE in vendor/extensions/site/public/[jsi]**/*; do
  9.  
  10. DIR=${FILE%/*}
  11. PUB=public/${DIR##*/}/${FILE##*/}
  12.  
  13. if [ -d $FILE ]; then
  14. echo "$FILE is a directory, skipping."
  15. elif [ -L $FILE ]; then
  16. echo "WARNING: $FILE is already a symlink. Not changed.";
  17. else
  18. diff -q $PUB $FILE
  19. if [ "$?" != "0" ]; then
  20. echo "ERROR: won't clobber"
  21. exit 1
  22. else
  23. echo "Linking $FILE"
  24. ln -sf ../../../../../$PUB $FILE
  25. fi
  26. fi
  27. done
Add Comment
Please, Sign In to add comment