Commit Graph

57 Commits

Author SHA1 Message Date
Quint Guvernator d246114678 add --no-meta switch to avoid some redundant events for #78 2020-06-23 14:41:53 +02:00
Quint Guvernator 524812028d add --no-environment switch to fix #78 2020-06-23 13:43:55 +02:00
Thomas Etter c50abc324c add Kate (KDE default editor) swap file to default ignores
.filename.kate-swp format https://unix.stackexchange.com/a/112400
2020-06-14 18:17:13 +02:00
Martin Sehnoutka f8f6c0ac5a Mention time units explicitly in CLI interface
The force-poll flag does not mention time units as opposed to the
debounce flag and to make it even more confusing, the comment in the
code says something else than the output:
*** Polling for changes every 2000 ms

This patch makes it clear what units are used.
2020-04-18 17:15:46 +12:00
daubaris 9a204241f7 Satisfying requested changes 2019-11-19 01:15:07 +13:00
daubaris 7ad8e78a34 Rename the command from 'watch-idle' to 'watch-when-idle' 2019-11-19 01:15:07 +13:00
daubaris de5ed1c2bd #123 --watch-idle flag implementation 2019-11-19 01:15:07 +13:00
Félix Saparelli 798fd3c0bd
Fix verb tense on help message for `--force-poll` 2019-11-11 09:51:06 +13:00
Félix Saparelli f7e1639ed1
Upgrade to winapi 0.3 2019-10-28 12:17:00 +13:00
Félix Saparelli e563ae8fc1
Enable anti-unwrap lints 2019-10-28 01:12:10 +13:00
Félix Saparelli a3c5bd7201
Run formatter 2019-10-28 00:31:52 +13:00
Félix Saparelli d47419e385
Forbid a whole lot more clippy stuff 2019-10-28 00:31:26 +13:00
Félix Saparelli b842c149b6
Use Rust 2018 2019-10-27 23:58:00 +13:00
Félix Saparelli f56e838fb9
Lints and clippys 2019-10-27 23:47:35 +13:00
Félix Saparelli 6b028cb649
Add builder for Args 2019-10-27 23:29:58 +13:00
Ryan James Spencer e90bbcb9bd Support a dedicated ignore file
ref. https://github.com/passcod/cargo-watch/issues/127

This adds support for a dedicated ignore file by the name of `.ignore` a
la `fd`, `ripgrep`, et. al.

This purely just mimics what `Gitignore` is doing except it doesn't
ignore `.git` directories. There might be more I need to tweak and the
interface might be too obtuse, but this is a first pass.

I've also added a `--no-ignore` flag which ignores both `.gitignore` and
the dedicated `.ignore`. It might make sense to add a specific flag that
ignores `.ignore` but respects `.gitignore` to support the old
behaviour, but I wasn't sure what to name it.
2019-10-12 14:13:57 +13:00
SpiralP dbc52e012e [run] Always canonicalize input paths (#113)
A client may pass non-canonicalized paths into `watch`, and these are therefore not matched against the filters correctly. Thus, some events could call a Handler's `on_update` method even when an ignored file was changed.

See repro: https://github.com/SpiralP/rust-cargo-watch-test

This bug was introduced in aae5a216b0.
2019-03-04 11:40:35 +13:00
Félix Saparelli 5e44cafb94 [windows] Attempt to use tput to clear the screen
In some situations, this may clear the screen better than a call to
`cls`, and in all other cases `cls` is called anyway.

May help #99
2019-01-26 15:22:09 +13:00
Félix Saparelli 6f473bcd87 [meta] Run formatter 2019-01-26 15:15:27 +13:00
Félix Saparelli aae5a216b0 [api] Make watchexec take a Handler rather than a callback
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.
2019-01-26 14:45:13 +13:00
David Ziegler 7b3daeef9c Major changes for c bindings integration as third party crate (see project: github/InfinityMod/watchexec_c).
Changed version to 1.9.3 for third party crate compatibility detection.
2019-01-23 18:56:09 +01:00
Félix Saparelli a6163cc599 Formatting 2018-09-08 20:08:36 +12:00
Félix Saparelli 21d4080183 Wrap whitespace in arguments
Fixes #82
Fixes #87
2018-08-22 07:15:20 +12:00
Bruce Guenter 1d8d6595e0 Add .pyo to the Python temporary file ignore
Python, when invoked with the -O option, writes compiled code to .pyo
files instead of .pyc. Add this to the default ignores list.
2018-02-08 14:53:12 -06:00
Bruce Guenter 422546b175 Add Emacs temporary files to the default ignored list
Emacs generates temporary backup files while editing named "#FILENAME#"
and ".#FILENAME". Ignore these by default.
2018-02-08 14:53:11 -06:00
Bruce Guenter c98bea3118 Fix default ignore for vim temporary files
.swp files are created by vim to store editing state while a file is
open. However, it may also create .swo, .swn, etc files if .swp already
exists. Also, the temporary files are always hidden (start with ".").
Finally, vim temporarily creates .swpx files as well which are caught by
inotify.

This change fixes the *.swp pattern to only match hidden files and to
match the other vim temporary files.
2018-02-08 14:53:08 -06:00
Jim McGrath 9b4e74ed30 fix screen clearing on windows 2017-12-06 11:40:04 -06:00
Josh Gao 76d959b27b Use `tput reset` to clear screen.
Use `tput reset` instead of `clear` so that scrollback is cleared in
addition to the currently visible portion of the terminal.
2017-11-21 00:55:58 -05:00
Matt Green 8770ae3967 Handle relative ignores better? 2017-10-07 15:50:47 -04:00
James Kominick 0e34123023 Add `-d, --debounce` option
- Add configurable debounce timeout option behind `-d, --debounce`
- Move `-d, --debug` flags to `-v, --verbose`
2017-09-07 19:44:57 -04:00
Matt Green 6ebb7bc7b3 Also ignore changes to ignored dirs themselves 2017-05-10 12:02:49 -04:00
Matt Green e6de016cb9 Ensure correct path separators are used for VCS ignore dirs 2017-04-27 15:39:12 -04:00
Matt Green f9a3cade26 Add common VCS dirs to default ignore list (fixes #54) 2017-04-27 15:20:44 -04:00
Les Aker 356dac189d add no-default-ignore option, fixes #45 2017-04-25 21:17:45 -04:00
Matt Green fe0d5243bd Remove /.* ignore pattern (see #45) 2017-04-25 16:48:44 -04:00
Chris Aumann a395ed84cd Remove useless format!()
This was a hint by `cargo clippy`
2017-04-10 00:20:57 +02:00
Chris Aumann df72aaf977 Use if-else statements instead of boolean match
This was a hint by `cargo clippy`
2017-04-10 00:20:57 +02:00
Chris Aumann 780b54b34e Port --no-shell to Windows 2017-04-10 00:20:57 +02:00
Chris Aumann ee5e93e6af Add support for --no-shell option 2017-04-10 00:19:58 +02:00
Chris Aumann 4763de3790 Re-add --kill flag for compatibility
--kill translates to --signal SIGKILL
2017-04-02 21:21:30 +02:00
Chris Aumann d5da94fcaf Add check for conflicting --signal and --postpone arguments 2017-04-02 21:21:30 +02:00
Chris Aumann c98d0e6cfd Decouple --restart and --signal, so they both make sense
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)
2017-04-02 21:21:30 +02:00
Chris Aumann 3a5ff290d5 Use a more idiomatic way to set --signal 2017-04-02 21:19:53 +02:00
Chris Aumann 68caf04269 First commit to add a generic --signal flag 2017-04-02 21:19:52 +02:00
Matt Green 125e7eb7c8 rustfmt & clippy fixes 2017-02-04 16:26:59 -05:00
Matt Green e16a6b3a24 Support watching multiple paths 2017-02-04 16:18:02 -05:00
Matt Green 53c1f39919 Load + handle multiple .gitignore files in project dir 2017-02-04 14:53:27 -05:00
Matt Green b2b0a60ca5 Add -1 option for integration testing, closes #35 2017-01-27 15:27:44 -05:00
Matt Green fd2d6e364a Add -k to support sending SIGKILL 2017-01-16 14:18:38 -05:00
Matt Green 171132a722 rustfmt & clippy fixes 2016-12-20 12:20:21 -05:00