Skip to content

Instantly share code, notes, and snippets.

@hugows
Last active December 9, 2021 13:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hugows/7aa364b0870476106e99ac884b2dd1ad to your computer and use it in GitHub Desktop.
Save hugows/7aa364b0870476106e99ac884b2dd1ad to your computer and use it in GitHub Desktop.
MacOs: Monitor new files, announce events, add new files to Yoink
This didn't work with fswatch, but chokidar with poll monitor was fine:
`chokidar '*.json' -p --poll-interval 1000 -c 'say "{event}" && open -a Yoink {path}'`
I was using this to debug a HTTP server that generated log files every X minutes, so I didn't have to keep checking the terminal.
Another useful idea is to send results of a script to yourself via [Telegram](https://github.com/fabianonline/telegram.sh):
`chokidar '*.json' -p --poll-interval 1000 -c 'check_file.sh {path} | telegram -'`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment