Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
fswatch_propagate_pwd_changes_to_docker
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
You can’t perform that action at this time.