-
Add the dependency to your
shard.yml:dependencies: fswatch: github: bcardiff/crystal-fswatch
-
Run
shards install
require "fswatch"
FSWatch.watch "." do |event|
pp! event
end
sleep 10 # keep main fiber busy to prevent exiting- Fork it (https://github.com/bcardiff/crystal-fswatch/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
For docker there are a couple of images to test things in alpine and ubuntu with crystal and libfswatch installed.
% docker build -t cfsw-ubuntu -f docker/Dockerfile.ubuntu .
% docker run --rm -it -v $(pwd):/src -w /src cfsw-ubuntu /bin/sh
root@5be1b17d7eba:/src# crystal run playground/01_monitor_curdir.cr
root@5be1b17d7eba:/src# crystal spec
To build other platforms use --platform linux/amd64
% docker build -t cfsw-ubuntu -f docker/Dockerfile.ubuntu --platform linux/amd64 .
- Brian J. Cardiff - creator and maintainer