That has a number of advantages:
- #193 the build.rs is only run for the CLI, so the Windows manifest is
not embedded in the library anymore, opening it up for downstreams.
- it sets the stage for decoupling the version numbers of the CLI and
library, to have the library increase its major more often, while the
CLI retains compatibility further… that is, to have both follow semver
- it removes the CLI-only dependencies from the library
- it makes compilation a bit faster as compiling the library and the
CLI's other dependencies can happen in parallel
One major disadvantage:
- installing via cargo changes from watchexec to watchexec-cli. Most
installs are from prebuilt and from packages, but that's still a
potential stumble.
And of course, the CLI APIs in the library are gone (they were already
deprecated, though).
We also take this opportunity to get rid of the clear_screen code and
use our new clearscreen library. #99#171#185
Instead of special-casing the callback, which is the path least-taken,
switch the internals to a Handler model, where the default behaviour is
an implementation of a Handler, and external callers can implement their
own Handlers and pass them in.
While doing so, change all unwraps in run::run to returning Errs, and
expand the watchexec Error enum to accommodate. That should make it
easier to use as a library.
Also, differentiate between "manual" and "on update" runs. For now the
only manual run is the initial run, but this paves the way for e.g.
keyboard- or signal- triggered runs.
issue #59
- Keep track of `notify::op::Op`s associated with each updated path
- Collect paths into `notify::op::Op` categories and pass them on as
environment vars
- Set a COMMON_PATH and use relative paths if more than one unique
path was touched
This change takes account of the following four use cases:
1. Make sure the previous run was ended, then run the command again (default)
2. Just send a specified signal to the child, do nothing more (--signal given)
3. Send SIGTERM to the child, wait for it to exit, then run the command again (--restart given)
4. Send a specified signal to the child, wait for it to exit, then run the command again (--restart and --signal given)