cargo-watch
cargo-watch copied to clipboard
How to exclude folders?
How do I instruct cargo watch to exclude folders? Doesn't seem to be supported so far, by the looks of cargo watch --help | grep exclude
.
cargo watch --ignore 'folder/*'
works for me.
You could also add /folder
to your .gitignore
to always exclude it in future invocations.
Thanks. In this particular case, I have a mixed-source project (ClojureScript & Rust) and I didn't want Cargo to restart when I touch my *.cljs files :)
/folder
in .gitignore
doesn't work.
I came here for this as well. I'd use an .ignore
file for the projects, where you want to version-control none source-code related things as well.
This will be properly supported with the new (experimental) filtering engine when it lands later this year:
$ env CARGO_WATCH_FILTERER=tagged cargo watch
I'll reclose when that arrives
Correction, this will be properly supported via .gitignore and .ignore in the default/normal mode for a future release which will include Watchexec 2.
Just my 2 pence: I want to ignore some folders which are checked into git. In my case, I have sass files which I want to version control but I don't want to restart the server every time I edit them - is that possible?
Thanks!
@yatesco that is supported, with --ignore '**/foldername/**
. This issue is for the /foldername
syntax from gitignore.
Thanks @passcod. For my situation cargo watch -w src -x run
is actually the simplest as the other folders are siblings of src
. Thanks :-)