php-spark/plugins/com.noccy.watcher
Chris 30dfd4889b Misc fixes and improvements
* Added request logging to com.noccy.apiclient
* Added plugin com.noccy.watcher
* Added pipe command and filter support
* Fixes and stubs
2021-12-14 23:01:25 +01:00
..
Commands Misc fixes and improvements 2021-12-14 23:01:25 +01:00
Monitor Misc fixes and improvements 2021-12-14 23:01:25 +01:00
FileWatcher.php Misc fixes and improvements 2021-12-14 23:01:25 +01:00
README.md Misc fixes and improvements 2021-12-14 23:01:25 +01:00
Rule.php Misc fixes and improvements 2021-12-14 23:01:25 +01:00
sparkplug.php Misc fixes and improvements 2021-12-14 23:01:25 +01:00

README.md

Watcher Plugin for Spark

Note: While the plugin currently supports wildcards, it does not scale well. Keep the watched files to a minimum or increase the interval if you experience issues.

Usage

$ spark watch

Installation

  1. Install Spark with global plugins
  2. Initialize your project: spark init
  3. Enable the plugin with spark plugin --enable com.noccy.watcher
  4. Configure your .spark/watchers.json file

Configuration

watchers.json

{
  "watchers": [
    {
      "name": "name-of-rule",
      "watch": [ "file1", "dir1/*" ],
      "initial-trigger": true,
      "actions": [
        "@build"
      ]
    }
  ]
}

The initial-trigger key controls whether the rule is triggered on startup.