forked from radixdlt/radixdlt-scrypto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
clean.sh
executable file
·30 lines (24 loc) · 860 Bytes
/
clean.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
#set -x
set -e
cd "$(dirname "$0")"
# clean this worksapce
cargo clean
# clean this and other workspaces folders
(
find "." -mindepth 2 -maxdepth 4 -type f \( -name Cargo.toml \) -print \
| awk '{print substr($1, 1, length($1)-length("Cargo.toml"))}' \
| xargs -I '{}' bash -c "echo cleaning '{}'; cd '{}'; cargo clean"
)
# clean assets/blueprints
(
find "assets/blueprints" -mindepth 2 -maxdepth 2 -type f \( -name Cargo.toml \) -print \
| awk '{print substr($1, 1, length($1)-length("Cargo.toml"))}' \
| xargs -I '{}' bash -c "echo cleaning '{}'; cd '{}'; cargo clean"
)
# clean examples
(
find "examples" -mindepth 2 -maxdepth 2 -type f \( -name Cargo.toml \) -print \
| awk '{print substr($1, 1, length($1)-length("Cargo.toml"))}' \
| xargs -I '{}' bash -c "echo cleaning '{}'; cd '{}'; cargo clean"
)