3 N_CPUS
=$
(nproc
2> /dev
/null || gnproc
2> /dev
/null || sysctl
-n hw.ncpu
2> /dev
/null
)
6 local -r dir
="${1-$HOME}"
7 local -r jobs="${1-$N_CPUS}"
9 # XXX Just doing 'rm -rf' because 'cargo clean' starts doing extra work
10 # and in some cases even downloads new deps, etc.
11 find "$dir" -type f
-name Cargo.toml
-print0 \
12 |
xargs -0 -I % -P "$jobs" sh
-c 'rm -rf $(dirname "%")/target'
This page took 0.095295 seconds and 4 git commands to generate.