Name | Type | Required | Default | Hint |
paths | string | false | ** | Comma-delimited list of file globbing paths to watch relative to the working directory, defaults to ** |
excludePaths | string | false | Comma-delimited list of file globbing paths to exclude relative to the working directory. | |
command | string | true | The command to run when the watcher fires | |
delay | number | false | 500 | How may milliseconds to wait before polling for changes, defaults to 500 ms |
directory | string | false | Working directory to start watcher in | |
verbose | boolean | false | false | Output details about the files that changed |
Watch the files in a directory and run a custom command of your choice
watch *.json "echo 'config file updated!'"The following environment variables will be available to your command
set command = "echo 'You added \${item}!'"Note in the above example, the ${watcher_added} and ${command} env vars in the "inner" command are escaped.
watch command="foreach '\${watcher_added}' \${command}" --verbose