2015-06-26 08:31:31 +00:00
|
|
|
# $ cargo watch
|
|
|
|
|
2018-08-21 05:59:48 +00:00
|
|
|
[![Crate release version](https://flat.badgen.net/crates/v/cargo-watch)](https://crates.io/crates/cargo-watch)
|
2022-01-22 05:08:23 +00:00
|
|
|
[![Crate license: Apache 2.0](https://flat.badgen.net/github/license/watchexec/cargo-watch)][license]
|
2018-08-21 05:59:48 +00:00
|
|
|
[![Crate download count](https://flat.badgen.net/crates/d/cargo-watch)](https://crates.io/crates/cargo-watch)
|
2021-06-23 06:35:24 +00:00
|
|
|
[![CI status](https://github.com/watchexec/cargo-watch/actions/workflows/check.yml/badge.svg)](https://github.com/watchexec/cargo-watch/actions/workflows/check.yml)
|
2022-01-22 05:04:58 +00:00
|
|
|
[![MSRV: 1.58.0](https://flat.badgen.net/badge/MSRV/1.58.0/purple)](https://blog.rust-lang.org/2022/01/13/Rust-1.58.0.html)
|
2019-12-10 06:20:09 +00:00
|
|
|
![MSRV policy: bump is non-breaking](https://flat.badgen.net/badge/MSRV%20policy/non-breaking/orange)
|
2018-02-25 06:30:30 +00:00
|
|
|
|
2015-12-27 11:47:37 +00:00
|
|
|
Cargo Watch watches over your project's source for changes, and runs Cargo
|
|
|
|
commands when they occur.
|
|
|
|
|
2021-04-11 12:47:33 +00:00
|
|
|
If you've used [nodemon], [guard], or [entr], it will probably feel familiar.
|
2015-12-27 11:47:37 +00:00
|
|
|
|
|
|
|
[nodemon]: http://nodemon.io/
|
2021-04-11 12:47:33 +00:00
|
|
|
[entr]: https://github.com/eradman/entr
|
2015-12-27 11:47:37 +00:00
|
|
|
[guard]: http://guardgem.org/
|
2014-08-04 11:11:31 +00:00
|
|
|
|
2022-01-22 05:08:23 +00:00
|
|
|
- License: [Apache 2.0][license].
|
2021-06-23 06:35:24 +00:00
|
|
|
- Website and more documentation: **[watchexec.github.io](https://watchexec.github.io)**.
|
2022-01-22 05:04:58 +00:00
|
|
|
- Minimum Supported Rust Version: 1.58.0.
|
Use caretaker maintainership
I've thought about this for a moment. I have been hesitant to apply
caretaker maintainership to cargo-watch even though the impetus for
creating this caretaker concept was the whole situation with cargo-watch
and notify and co. Small projects are a different beast to something
that is used throughout the community and has 1.5k stars on github, as
much or as little you can attach any value to such measurement.
Ultimately, though, this is the same kind of thinking that got me to so
spectacularly and decisively burn out of notify. The truth of the size
of the project is that it's mostly just me. Just me writing most of the
code, just me doing the releases, just me managing issues and requests
that have been piling on without resolution for the best part of three
years.
Caretaker, at its heart, is merely a formalisation and acceleration of a
process that already happens in open source. It does that to try to make
it even easier and more common, yes, but it's not fundamentally creating
anything new.
IF, AS A RESULT OF THIS CHANGE, YOU HAVE CONCERNS ABOUT SUPPLY CHAIN
ATTACKS, YOUR ONLY WAY TO SOLVE IT IS TO ***ACTIVELY*** TAKE OVER THE
PROJECT AS A COMMITTED MAINTAINER. If you are truly committed, I will
even facilitate this as best I can.
Kia ora
2021-03-07 01:47:50 +00:00
|
|
|
|
2022-01-22 05:08:23 +00:00
|
|
|
[license]: https://www.apache.org/licenses/LICENSE-2.0.html
|
2020-12-16 01:10:51 +00:00
|
|
|
|
2016-01-23 23:21:13 +00:00
|
|
|
## Install
|
2014-08-04 11:11:31 +00:00
|
|
|
|
2021-09-28 12:35:38 +00:00
|
|
|
<a href="https://repology.org/project/cargo-watch/versions"><img align="right" src="https://repology.org/badge/vertical-allrepos/cargo-watch.svg" alt="Packaging status"></a>
|
|
|
|
|
2021-06-28 11:35:14 +00:00
|
|
|
Pre-built binaries are available **[from the website][cw-downloads]** or
|
|
|
|
alternatively [on the Github Releases tab][releases]. Since 7.8.0, checksums and
|
|
|
|
signatures are also provided; see [download documentation][downloads] for details.
|
|
|
|
|
|
|
|
[cw-downloads]: https://watchexec.github.io/downloads/cargo-watch
|
|
|
|
[downloads]: https://watchexec.github.io/downloads/
|
|
|
|
[releases]: https://github.com/watchexec/cargo-watch/releases
|
2018-08-21 06:50:51 +00:00
|
|
|
|
2017-03-29 13:24:28 +00:00
|
|
|
```
|
2017-04-26 08:04:51 +00:00
|
|
|
$ cargo install cargo-watch
|
2017-03-29 13:24:28 +00:00
|
|
|
```
|
2014-08-04 11:11:31 +00:00
|
|
|
|
2021-03-06 09:37:52 +00:00
|
|
|
With [cargo-binstall](https://github.com/ryankurte/cargo-binstall):
|
|
|
|
|
|
|
|
```
|
|
|
|
$ cargo binstall cargo-watch
|
|
|
|
```
|
|
|
|
|
2016-12-29 03:51:02 +00:00
|
|
|
Or clone and build with `$ cargo build` then place in your $PATH.
|
2016-01-23 23:21:13 +00:00
|
|
|
|
2021-04-11 14:00:08 +00:00
|
|
|
This repository contains a [manual page](./cargo-watch.1) and
|
|
|
|
[Zsh completions](./completions) that you may want to install.
|
|
|
|
|
2016-01-23 23:21:13 +00:00
|
|
|
## Usage
|
2014-12-21 02:12:22 +00:00
|
|
|
|
2021-04-11 12:47:33 +00:00
|
|
|
By default, it runs `check`. You can easily override this, though:
|
2014-08-04 11:11:31 +00:00
|
|
|
|
2017-03-29 13:24:28 +00:00
|
|
|
```
|
|
|
|
$ cargo watch [-x command]...
|
|
|
|
```
|
|
|
|
|
2015-12-27 11:47:37 +00:00
|
|
|
A few examples:
|
2014-08-04 11:11:31 +00:00
|
|
|
|
2017-03-29 13:24:28 +00:00
|
|
|
```
|
|
|
|
# Run tests only
|
|
|
|
$ cargo watch -x test
|
2016-01-31 03:17:37 +00:00
|
|
|
|
2017-03-29 13:24:28 +00:00
|
|
|
# Run check then tests
|
|
|
|
$ cargo watch -x check -x test
|
|
|
|
|
|
|
|
# Run run with arguments
|
|
|
|
$ cargo watch -x 'run -- --some-arg'
|
|
|
|
|
|
|
|
# Run an arbitrary command
|
2021-04-11 12:47:33 +00:00
|
|
|
$ cargo watch -- echo Hello world
|
2020-06-17 17:37:52 +00:00
|
|
|
|
|
|
|
# Run with features passed to cargo
|
2020-06-21 11:29:03 +00:00
|
|
|
$ cargo watch --features "foo,bar"
|
2017-03-29 13:24:28 +00:00
|
|
|
```
|
|
|
|
|
2022-01-22 05:04:58 +00:00
|
|
|
There's a lot more you can do! Check out:
|
2017-03-29 13:24:28 +00:00
|
|
|
|
2022-01-22 05:04:58 +00:00
|
|
|
- [Usage guide](./USAGE.md)
|
|
|
|
- [Manual page](./cargo-watch.1.ronn)
|
|
|
|
- [Troubleshooting](./TROUBLESHOOT.md)
|
2017-04-18 05:17:38 +00:00
|
|
|
|
2017-03-29 13:24:28 +00:00
|
|
|
## About
|
2015-03-19 08:01:31 +00:00
|
|
|
|
2015-12-27 11:47:37 +00:00
|
|
|
Created by [Félix Saparelli][passcod] and [awesome contributors][contributors].
|
2015-03-19 08:01:31 +00:00
|
|
|
|
2021-06-23 06:35:24 +00:00
|
|
|
[contributors]: https://github.com/watchexec/cargo-watch/network/members
|
2015-12-27 11:47:37 +00:00
|
|
|
[passcod]: https://passcod.name
|