Félix Saparelli
166f0b8fc2
Drop default debounce to 300ms (cf #168 )
2020-09-30 16:48:24 +13:00
Félix Saparelli
f2da804d3b
Correct --watch help text as per #165
2020-09-15 13:21:02 +12:00
Félix Saparelli
570ed3afdf
Add windows manifest to enable long path support ( #163 )
...
- `requestedPrivileges`: explicitly set privilege level to be the same as parent
- `longPathAware`: opt into transparent long path support on Win10 and above
2020-07-19 16:14:23 +12:00
Félix Saparelli
fdb0cfb759
Add soft deprecation on Args.debug
2020-07-04 17:42:13 +12:00
Félix Saparelli
0b5120430c
Revise clippy lints to avoid breakage
2020-07-04 00:38:50 +12:00
Félix Saparelli
f38e7ab969
Cargo fmt
2020-07-04 00:20:02 +12:00
Félix Saparelli
0b13c39056
Merge pull request #160 from PhilipDaniels/main
2020-07-03 23:32:49 +12:00
Philip Daniels
03142f5ec1
Call init_logger after parsing the args.
2020-06-25 11:16:22 +01:00
Philip Daniels
ebd5ec084f
Do not call init_logger from inside watch.
...
And move init_logger to main.rs for future use.
2020-06-24 15:17:59 +01:00
Quint Guvernator
2615a1de7c
wrap ioerror when it represents oserror E2BIG
2020-06-24 13:40:11 +02:00
Quint Guvernator
cca7b19283
fix some clippy lints
2020-06-24 10:58:15 +02:00
Quint Guvernator
7770de8f7c
test: add new arguments to spawn(...)
2020-06-23 15:02:10 +02:00
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
Félix Saparelli
92029f7365
Fix faulty .git lookup code
2020-06-06 15:16:02 +12:00
Félix Saparelli
be6c29c821
Merge pull request #147 from Chris-Nicholls/gitignore
2020-06-04 19:29:53 +12: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
Chris Nicholls
2d29a7d7c4
Look for .ignore files in subfolders of watched paths
2020-03-09 10:59:02 +00:00
Chris Nicholls
0175e071e1
Include .gitignores in subdirectories
2020-03-06 10:28:29 +00:00
Félix Saparelli
5843deb573
Allow clippy::too_many_lines
2019-11-19 19:42:20 +13:00
daubaris
50fa771c41
Adding missed details
2019-11-19 01:15:07 +13: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
90b9a85c0c
Swap out deprecated mem::uninitialized()
2019-11-19 00:38:58 +13:00
Thomas Etter
6e64a2c152
update the test to make sure that files matching part of the ignore are not excluded
2019-11-12 23:36:49 +13:00
Thomas Etter
1c6f5fab89
fix the ignore path handling to match the README by ignoring everything
...
below a directory
2019-11-12 23:36:49 +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
e33fd8f5b5
Remove borrowing that was introduced in previous release
2019-10-28 22:32:08 +13:00
Félix Saparelli
bb02d84661
Re-export useful things
2019-10-28 18:56:06 +13:00
Félix Saparelli
6c653e8e52
Return owned Args from Handler instead of borrowed
2019-10-28 18:55:39 +13:00
Wayne Warren
720ff44b71
#133 : leave Handler initialization to watch caller
2019-10-28 18:17:25 +13:00
Félix Saparelli
a1fbad0180
Fix last clippy lints
2019-10-28 13:48:57 +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
5f7123ecbe
Lint tests too
2019-10-28 00:37:24 +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
Félix Saparelli
8e84eb6b04
Add semver policy statement
2019-10-27 22:54:44 +13:00
Josh Soref
0d4a2270ec
spelling: supporting
2019-10-14 11:09:51 +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
Igor Gnatenko
22f5408bc0
Drop mktemp dependency ( #115 )
...
It is not used and depends on very very old version of uuid.
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2019-03-12 00:49:17 +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
4918b123d9
[run] Restore clearing of the screen on initial run
2019-02-18 21:26:21 +13:00
Josh Gao
6342f86c10
[errors] Fix infinite recursion in fmt::Display for Error ( #111 )
2019-02-15 17:02:07 +13:00
Félix Saparelli
8eb90738de
[run] Move "once" logic to be entirely within handler
2019-01-27 15:51:49 +13:00
Félix Saparelli
4ceb70f6bf
[docs] Fix logic inversion in on_manual doc comment
2019-01-27 10:24:24 +13:00
Félix Saparelli
578ffa1deb
[run] Fix outdated comment in ExecHandler
2019-01-26 17:42:36 +13:00
Félix Saparelli
5846b64020
[run] Further dry the ExecHandler
2019-01-26 17:32:48 +13:00
Félix Saparelli
3dd2f797ab
[process] Remove some more unwrap
2019-01-26 17:26:33 +13:00
Félix Saparelli
6a23f77687
[run] Pass ops by reference when possible
2019-01-26 17:20:29 +13:00
Félix Saparelli
ede5505a6b
[run] Dry spawning the child process
2019-01-26 17:16:07 +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
Félix Saparelli
ac3a4f0717
[pathop] Revert changes adding a time field
2019-01-26 14:40:30 +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
Magnus Bergmark
9fd25dd667
Use setsid() instead of setpgid()
...
This makes it possible to run commands that allocates TTYs and still
capture their output and reap the process on completion.
> setpgid — set process group ID for job control
> setsid — create session and set process group ID
With this in place, the `waitpid` call detects that the process has
exited even if the process allocated a TTY, and is able to unblock the
runner and continue.
Further, the output of the command is also shown in the controlling
terminal.
2019-01-17 13:21:27 +01:00
Félix Saparelli
f6b16813aa
Cfg off remaining items for a clean win/mac build
...
Closes #98
2018-10-05 20:56:06 +13:00
Félix Saparelli
ba23ed09f6
Fix tests
2018-09-09 16:16:40 +12:00
Félix Saparelli
dc712197c0
1.9.2: revert whitespace changes
2018-09-09 16:03:01 +12:00
Félix Saparelli
3c1eaa51f7
Add missing impl for StdError
2018-09-09 10:38:07 +12:00
Félix Saparelli
2c5c145042
Extract errors into one thing and return a result more often
2018-09-08 23:51:44 +12:00
Félix Saparelli
a6163cc599
Formatting
2018-09-08 20:08:36 +12:00
Félix Saparelli
9c60148b66
Merge pull request #95 from watchexec/wrap-whitespace-in-args
...
Wrap whitespace and quotes in command arguments
2018-09-08 19:44:39 +12:00
Félix Saparelli
718647e386
Merge branch 'master' into fix_panic
2018-09-08 19:43:20 +12:00
Félix Saparelli
7375db5ce9
Also wrap when there’s quotes but no whitespace
2018-08-22 08:17:36 +12:00
Félix Saparelli
21d4080183
Wrap whitespace in arguments
...
Fixes #82
Fixes #87
2018-08-22 07:15:20 +12:00
Félix Saparelli
39a4a52f80
Restore 1.20 compatibility
2018-08-22 07:14:55 +12:00
Félix Saparelli
ef0e6df8d4
Remove duplication between main/lib files
2018-08-22 00:10:57 +12:00
Félix Saparelli
f61b7507af
Update dependencies
2018-08-19 20:58:47 +12:00
Félix Saparelli
31fdca564a
Merge pull request #93 from tailhook/max_user_watches
...
Add a warning and fallback on polling mode if limit exceeded
2018-08-19 20:29:44 +12:00
Félix Saparelli
93bd1d9881
Merge pull request #77 from bruceg/master
...
Fix some default ignore pattern issues
2018-08-19 20:23:49 +12:00
Paul Colomiets
a2d0a251da
Add a warning and fallback on polling mode if limit exceeded
...
Works only on linux (not sure how error is named on other systems):
```
*** System notification limit is too small, falling back to polling
mode.
*** For better performance increase system limit:
sysctl fs.inotify.max_user_watches=524288
*** Polling for changes every 1000 ms
```
Fixes #62
2018-08-02 19:36:50 +03:00
Oliver Jan Krylow
8de93a8fd2
Bumps __nix__ to __0.11.0__ in order to support OpenBSD 6.3+.
2018-07-30 21:20:12 +02: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
James Kominick
31b5e56959
don't panic on missing folder
...
issue #71
- Add some basic error handling
- Convert missing folder panic to error
2017-12-13 23:10:12 -05: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
3de894e07c
Merge pull request #70 from mattgathu/fix_clippy_warnings_run
...
fix (src/run.rs): fixed cargo clippy warnings
2017-10-09 08:54:41 -04:00
Matt Green
b035cbf44a
Merge pull request #69 from mattgathu/fix_clippy_warnings_process
...
fix (src/process.rs): fix cargo clippy linter warnings
2017-10-09 08:53:55 -04:00
Matt Green
8770ae3967
Handle relative ignores better?
2017-10-07 15:50:47 -04:00
Matt Gathu
8509cbfd77
fix (src/run.rs): fixed cargo clippy warnings
...
This addresses warnings reported by cargo clippy on `src/run.rs`:
* warning: this expression borrows a reference that is immediately dereferenced by the compiler
reference:
- https://rust-lang-nursery.github.io/rust-clippy/v0.0.165/index.html#needless_borrow
- https://github.com/rust-lang-nursery/rust-clippy
2017-10-06 14:31:36 +03:00
Matt Gathu
775eb47dde
fix (src/process.rs): fix cargo clippy linter warnings
...
This PR fixes lint warnings generated by cargo-clippy:
- **warning**: you should put `notify::ops::RENAME` between ticks in the documentation
- **warning**: use of `or_insert` followed by a function call
I have run `cargo test` and these changes do not break any of the tests :-)
reference:
--
* https://rust-lang-nursery.github.io/rust-clippy/v0.0.165/index.html#doc_markdown
* https://rust-lang-nursery.github.io/rust-clippy/v0.0.165/index.html#or_fun_call
* https://github.com/rust-lang-nursery/rust-clippy
2017-10-06 13:55:21 +03:00
James Kominick
8bd9bb3c25
detailed update information
...
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
2017-09-09 13:55:44 -04:00
Matt Green
06fd2954dd
Merge pull request #64 from jaemk/configurable_debounce
...
Add `-d, --debounce` option
2017-09-08 16:16:19 -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
Lilian A. Moraru
e39256cfb2
Update dependencies and other small improvements
2017-08-26 22:07:06 +03:00
Matt Green
3fc501c4f0
Windows: fix waiting for job to finish; closes #55
2017-05-18 13:22:46 -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