cargo-watch/README.md

91 lines
2.9 KiB
Markdown
Raw Normal View History

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)
[![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
Cargo Watch watches over your project's source for changes, and runs Cargo
commands when they occur.
If you've used [nodemon], [guard], or [entr], it will probably feel familiar.
[nodemon]: http://nodemon.io/
[entr]: https://github.com/eradman/entr
[guard]: http://guardgem.org/
2014-08-04 11:11:31 +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.
[license]: https://www.apache.org/licenses/LICENSE-2.0.html
2020-12-16 01:10:51 +00:00
## Install
2014-08-04 11:11:31 +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
```
Or clone and build with `$ cargo build` then place in your $PATH.
This repository contains a [manual page](./cargo-watch.1) and
[Zsh completions](./completions) that you may want to install.
## Usage
2014-12-21 02:12:22 +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]...
```
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
$ 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
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
[passcod]: https://passcod.name