Created
November 11, 2018 23:35
-
-
Save italomaia/8d0886e9deb02bcc02b49eeb91af8d3a to your computer and use it in GitHub Desktop.
watch and compile moon files
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
#!/bin/sh | |
inotifywait -m -r -q --exclude "" -e create -e close_write -e move $(pwd) | | |
while read path action file; do | |
if [[ $path == \.moon$ ]]; then | |
if [ $action = 'MOVED_FROM' ] || [ $action = 'DELETE' ]; then | |
rm "${path/\.moon$/.lua}"; # clean up lua file | |
else | |
moonc $path; | |
fi | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment