Created
September 1, 2018 19:31
-
-
Save bds/0b52c141441c99d4fc4d8354284dd248 to your computer and use it in GitHub Desktop.
Use inotify modify events to compile Crystal Lang
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
#! /usr/bin/env sh | |
# | |
# https://github.com/rvoicilas/inotify-tools/wiki#inotifywait | |
# | |
CURPATH=`pwd` | |
inotifywait -mr \ | |
--exclude "[^c][^r]$" \ | |
--timefmt '%d/%m/%y %H:%M:%S' --format '%T %w %f' \ | |
-e modify /usr/src/app/my-app/src | while read date time dir file; do | |
FILECHANGE=${dir}${file} | |
FILECHANGEREL=`echo "$FILECHANGE" | sed 's_'$CURPATH'/__'` | |
echo $time $FILECHANGEREL | |
crystal build --no-codegen $FILECHANGEREL | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment