#!/bin/bash

DIR="$(dirname "$(readlink -f "$0")")"
COMPILE_CMDS=$DIR/../../compile_commands.json

rc -J $COMPILE_CMDS
inotifywait -q -m -e close_write --format %e $COMPILE_CMDS |
while read events; do
    echo Changed detected, running rc -J $COMPILE_CMDS
    rc -J $COMPILE_CMDS 
done 
