๐Ÿ’‚ Guardian

Guardian watches over your files and run assigned tasks.

View project on GitHub


brew tap f/guardian
brew install guardian


guardian init

Running Guardian

$ guardian
๐Ÿ’‚Guardian is on duty!


.guardian.yml is a simple YAML file.

Simply it has YAML documents with seperated by --- line and each document has files and run keys.

files key needs a glob pattern, and run is a shell command what to run.

files: ./**/*.cr
run: crystal build ./src/yourapp.cr
files: ./shard.yml
run: crystal deps

%file% Variable

Guardian replaces %file% variable in commands with the changed file.

files: ./**/*.txt
run: echo "%file% is changed"

Think you have a hello.txt in your directory, and Guardian will run echo "hello.txt is changed" command when it's changed.