Utility bash scripts for cargo
, git
, etc.
cargo-clean
searches for target
folders and Cargo.toml
files in a given
directory. For all found sub directories, cargo clean
is executed.
cargo-clean <directory>
cargo-clean <directory> --dry-run
cargo-clean ~/my_rust_projects
A dry run of cargo-clean
is accomplished via parameter --dry-run
:
cargo-clean ~/my_rust_projects --dry-run
> Checking ~/my_rust_projects for Rust targets
> cargo clean ~/my_rust_projects/serde (dry run)
> cargo clean ~/my_rust_projects/tokio (dry run)
> cargo clean ~/my_rust_projects/rayon (dry run)
> 3 targets removed (dry run)
cargo-regression
runs all integration tests which are behind feature flag
"integration-test" on two branches. Some of these tests may fail. It then compares
the test results and determines if any regression did occur.
- Copy script to
~/bin
- Add
~/bin
to PATH:export PATH="$HOME/bin:$PATH"
- Make script executable:
chmod u+x cargo-regression
- Run the script in your local Rust project:
cargo-regression
git-checkout
searches all local branches for keywords and checks out the matched
branch. If the branch couldn't be found locally, all remote branches are
searched. The matched branch is checked out locally and set up to track the
remote branch.
git-checkout <keyword1> <keyword2> <keyword3> ... <keywordn>
git-checkout <keyword1> <keyword2> <keyword3> ... <keywordn> --dry-run
git-checkout fix bug
> Searching for pattern: *fix*bug*
> Switched to branch 'bug-386729-fix-terrible-bug'
> Your branch is up to date with 'origin/bug-386729-fix-terrible-bug'.
git-checkout fix bug
> Searching for pattern: *fix*bug*
> Branch 'bug-386729-fix-terrible-bug' set up to track remote branch 'bug-386729-fix-terrible-bug' from 'origin'.
> Switched to a new branch 'bug-386729-fix-terrible-bug'