Accept a name for dl and include starter script file
[khome.git] / bin / cargo-clean-all
... / ...
CommitLineData
1#! /bin/bash
2
3N_CPUS=$(nproc 2> /dev/null || gnproc 2> /dev/null || sysctl -n hw.ncpu 2> /dev/null)
4
5main() {
6 local -r dir="${1-$HOME}"
7 local -r jobs="${1-$N_CPUS}"
8
9 find "$dir" -type f -name Cargo.toml -print0 \
10 | xargs -0 -I % -P "$jobs" sh -c 'rm -rf $(dirname "%")/target'
11}
12
13main "$@"
This page took 0.028136 seconds and 4 git commands to generate.