Skip to content

Instantly share code, notes, and snippets.

@frullah
Last active June 15, 2021 16:29
Show Gist options
  • Save frullah/15682de6caff287868f41aeb2851ee15 to your computer and use it in GitHub Desktop.
Save frullah/15682de6caff287868f41aeb2851ee15 to your computer and use it in GitHub Desktop.
auto reload code using inotifywait
#!/bin/bash
files_to_watch=$@
file_to_run=$1
inotifywait -e close_write $files_to_watch -m | while read file _event; do bundle exec ruby $file_to_run; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment