Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rhyskeepence/trigger
Cross platform file system watcher for build-and-restart workflows
https://github.com/rhyskeepence/trigger
Last synced: about 1 month ago
JSON representation
Cross platform file system watcher for build-and-restart workflows
- Host: GitHub
- URL: https://github.com/rhyskeepence/trigger
- Owner: rhyskeepence
- License: bsd-3-clause
- Created: 2017-12-06T14:48:56.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-29T16:14:39.000Z (almost 7 years ago)
- Last Synced: 2024-10-28T14:21:52.547Z (about 2 months ago)
- Language: Haskell
- Homepage:
- Size: 47.9 KB
- Stars: 9
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Trigger
`Trigger` is a cross platform file system watcher for super fast build-and-restart workflows. When files change, it can be configured to:
- run build tasks
- restart your app in the background`fswatch` and others are good general purpose tools for triggering tasks on filesystem changes.
However, they don't support stopping and starting background processes.# How does it work?
```
-------------------------------
| start processes in background |
-------------------------------
|
wait for change <-----------
| |
------------------------------- |
| stop background processes | |
------------------------------- |
| |
------------------------------- |
| run build tasks sequentially | |
------------------------------- |
| |
------------------------------- |
| start processes in background | |
------------------------------- |
| |
---------------------```
# Installation
It's Haskell, so download Stack.
Clone and run `stack build --install`
This should install `trigger` on your PATH.
If you get linking issues on Windows, see [this issue](https://github.com/commercialhaskell/stack/issues/425)
# Configuration
Create a file named `trigger.yaml`
Here is an example:
```yaml
- dirs:
- "src"
files:
- "**/*.hs"
ignore:
- "**/Ignored.hs"
tasks:
- "stack build"
exec:
- "target/executable"
```Which consists of:
- `dirs`: one or more directories to watch for changes. To reduce file handles, it is best to keep this as scoped as possible (rather than using `.`).
- `files`: one or more file globs, relative to the current working directory. Files that don't match will not trigger.
- `ignore`: (optional) one or more file globs. Overrides the above file globs to exclude particular files.
- `clearScreen`: (optional boolean) The default is to clear the screen when a file changes. Set this to false to disable this behaviour.
- `tasks`: (optional) one or more tasks, which are run sequentially in the foreground. Any error will stop subsequent tasks.
- `exec`: (optional) one or more background processes.This configuration can be repeated for other directories and tasks.