#!/bin/bash
DIR=/home/marcel/code/bookmarks/
while RES=$(inotifywait -e create -e modify -e delete -e move -r $DIR --format %f .)
do
	sleep 1
	echo `date` :: $RES
	cp -R /home/marcel/code/bookmarks/* /home/marcel/code/nextcloud_docker_container/custom_apps/bookmarks/
	sudo -u marcel -i <<-END
	. /home/marcel/.bashrc
	. /home/marcel/.bash_profile
	cd "$DIR"
	npm run lint:fix
	END
done
