Created
October 16, 2014 06:24
-
-
Save ikatson/7c6a7e84339305090457 to your computer and use it in GitHub Desktop.
fswatch_propagate_pwd_changes_to_docker
This file contains 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
function fswatch_propagate_pwd_changes_to_docker () { | |
echo "Starting fswatch on $PWD" | |
# tracking previous not to get into endless loop of changing the same file | |
local previous='' | |
fswatch -r "$PWD" | while read file; do | |
if [[ previous != "$file" ]]; then | |
docker run --rm -v "$PWD":"$PWD" busybox touch -c "$file" | |
fi | |
previous="$file" | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment