Created
June 30, 2014 07:01
-
-
Save laurentlemaire/e423b4994c7452cddbd2 to your computer and use it in GitHub Desktop.
Vagrant rsync watcher (Mac osx)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
## | |
# Keep local path in sync with remote path on server. | |
# Ignore .git metadata. | |
# | |
local=$BASEDIR | |
project='projetctname' | |
remote='[email protected]:/var/www/'$project | |
# Initialization - copy entire directory to host | |
if [ $1 = "init" ]; then | |
echo "Project Initialization" | |
rsync -riau ./* $remote | |
fi | |
# Watch for changes | |
echo "Watching for new changes..." | |
cd "$local" && | |
fswatch . "date +%H:%M:%S && rsync -iau --exclude='.git' --exclude='.idea/*' --exclude='app/cache' --exclude='app/logs' --exclude='web/temp/xml' --exclude='web/dynamic' --exclude-from='.gitignore' --delete . $remote" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment