Watcher-fs CLI Actions
Notify
- watcher_fs.actions.notify.action(changes)
Process file changes and execute the notify function for each change.
- watcher_fs.actions.notify.notify(file: Path, event_type: str)
Notify Action implementation
- Parameters:
file – Path of the file which was changed/created/deleted
event_type – str of the event which happened: changed/created/deleted
Cmd
- watcher_fs.actions.cmd.action(changes, **kwargs)
Process file changes and execute the cmd function for each change.
- watcher_fs.actions.cmd.cmd(file: Path, event_type: str, **kwargs)
Execute a command in the console for a file change event.
- Parameters:
file – Path object representing the changed file.
event_type – String describing the event (e.g., ‘created’, ‘modified’).
**kwargs – Additional parameters, must include ‘cmd’ with the command template.
- Raises:
RuntimeError – If ‘cmd’ is not defined in kwargs.
subprocess.CalledProcessError – If the command execution fails.