Crates.io | cargo-auto-run |
lib.rs | cargo-auto-run |
version | 0.1.2 |
source | src |
created_at | 2024-07-28 10:40:30.107877 |
updated_at | 2024-07-30 09:47:13.762137 |
description | A file watcher for Rust projects that runs a specified command on file changes. |
homepage | |
repository | https://github.com/crypto-priest/cargo-auto-run |
max_upload_size | |
id | 1317932 |
size | 17,802 |
Here's the full README.md for your CLI tool, Cargo Auto-Run:
Cargo Auto-Run is a versatile CLI tool that watches for file changes in a specified directory and runs a specified command if changes are detected. This tool is particularly useful for automatically running commands like cargo run
whenever you make changes to your code, but it can be used with any command you specify.
cargo run
.To install Cargo Auto-Run, use the following command:
cargo install cargo-auto-run
To use Cargo Auto-Run, navigate to the directory you want to watch and run the following command:
cargo-auto-run --command "<command>"
--command <command>
: The command to run on file changes. This should be the full command you want to execute, e.g., cargo run
, make build
, npm start
, etc.To watch the current directory for changes and run cargo run
if any changes are detected, use:
cargo-auto-run --command "cargo run"
You can also use it with any other command. For example, to watch for changes and run npm start
, use:
cargo-auto-run --command "npm start"