๐Ÿ’‚ Guardian

Guardian watches over your files and run assigned tasks.

View project on GitHub

Installation

brew tap f/guardian
brew install guardian

Usage

guardian init

Running Guardian

$ guardian
๐Ÿ’‚Guardian is on duty!

Configuration

.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.