Experiment scaling via launch of mate-settings-daemon
[khome.git] / home / bin / cargo-clean-all
CommitLineData
70dc9e92
SK
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
1487ce57
SK
9 # XXX Just doing 'rm -rf' because 'cargo clean' starts doing extra work
10 # and in some cases even downloads new deps, etc.
70dc9e92
SK
11 find "$dir" -type f -name Cargo.toml -print0 \
12 | xargs -0 -I % -P "$jobs" sh -c 'rm -rf $(dirname "%")/target'
13}
14
15main "$@"
This page took 0.033022 seconds and 4 git commands to generate.