If you don't know it already, `entr` is a great command to run a command when file(s) change.
Great way to add β€œrun my tests automatically when the files change”
manpages.ubuntu.com/manpages/f

Follow

$ ( ls Cargo.toml ; find ./src/ -type f -name '*.rs' ) | entr -r cargo test

this is what I use to automatically run tests when a file is saved
@rust

Β· Β· 2 Β· 1 Β· 0

@musicmatze I put a $ at the start to show it's a shell command. Then a () as subshell to group the stdout to pipe both into entr

@ebel ah, yeah. I thought you were using a subshell ... πŸ™‚

@dnaka91 @rust yeah, I found out about entr after cargo watch. I can't remember now why I switched.

Right now, I want to run check, then test, then run a specific script to do some real world stuff. With entr that's easy. I can't remember how it works with cargo watch

Sign in to participate in the conversation
⛧ MOYTURA ⛧

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!