Skip to content

Instantly share code, notes, and snippets.

@kamyuentse
kamyuentse / cargo-clean.sh
Created October 12, 2017 15:40
Clean cargo project directory recursively
#!/bin/bash
# This a simple bash script to run `cargo clean` recursively.
#
# Usage: `bash cargo-clean.sh target_dir`
clean_recursive() {
# First, check whether current directiry is the root of a cargo project.
if [ -f "Cargo.toml" ]; then
echo "Cleaning \"$(pwd)\""