Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #
- # for each file in site/public/ dir, link it to the main /public dir so it can be edited directly.
- #
- # This script should be run AFTER the server is started, not before.
- #
- #
- for FILE in vendor/extensions/site/public/[jsi]**/*; do
- DIR=${FILE%/*}
- PUB=public/${DIR##*/}/${FILE##*/}
- if [ -d $FILE ]; then
- echo "$FILE is a directory, skipping."
- elif [ -L $FILE ]; then
- echo "WARNING: $FILE is already a symlink. Not changed.";
- else
- diff -q $PUB $FILE
- if [ "$?" != "0" ]; then
- echo "ERROR: won't clobber"
- exit 1
- else
- echo "Linking $FILE"
- ln -sf ../../../../../$PUB $FILE
- fi
- fi
- done
Add Comment
Please, Sign In to add comment