trigger: Trigger is a cross platform file system watcher for super fast build-and-restart workflows.

[ bsd3, library, program, web ] [ Propose Tags ] [ Report a vulnerability ]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 1.0.0.0, 1.0.1.0, 1.0.2.0
Dependencies aeson, ansi-terminal, base (>=4.7 && <5), clock, directory, exceptions, filepath, formatting, fsnotify, Glob, process (>=1.5), protolude, text, time, trigger, twitch, yaml [details]
License BSD-3-Clause
Copyright 2017 Rhys Keepence
Author Rhys Keepence
Maintainer rhys@rhyskeepence.com
Category Web
Home page https://github.com/rhyskeepence/trigger
Uploaded by rhyskeepence at 2017-12-18T17:54:09Z
Distributions
Executables trigger
Downloads 1837 total (9 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-12-20 [all 4 reports]

Readme for trigger-1.0.2.0

[back to package description]

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

Configuration

Create a file named trigger.yaml

Here is an example:

- dirs:
    - "src"
  files:
    - "**/*.hs"
  ignore:
    - "**/Ignored.hs"
  tasks: 
    - "stack build"
  run:
    - "target/executable"      

Which consists of:

  • dirs: one or more directories to watch for changes
  • files: one or more file globs. Files that don't match will not trigger.
  • ignore: (optional) one or more file globs. Overrides the above file globs to exclude particular files.
  • tasks: (optional) one or more tasks, which are run sequentially in the foreground. Any error will stop subsequent tasks.
  • run: (optional) one or more background processes.