-
Notifications
You must be signed in to change notification settings - Fork 35
/
clean
executable file
·27 lines (21 loc) · 986 Bytes
/
clean
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
#!/bin/bash
#
# A basic script to clean all of the build artifacts and installed
# modules. Order matters, and it's easy to overlook something. In the
# future this could be structured to be done via a single
# one-build-tool-to-rule-them-all command, but currently we've a
# plethora of tooling and this is at least a starting point.
source $(dirname $0)/logging.sh
cd $ROOT
status "Cleaning all of the things."
status "[1/4] Expunging the Bazel bits."
./tools/bazelisk clean --expunge || fail "Unable to clean Bazel."
status "[2/4] Cleaning with sigh."
./tools/sigh clean || fail "Unable to clean sigh."
status "[3/4] Removing installed node modules."
# Search for and delete all node_modules folders (-prune stops it from
# recursively searching inside node_modules folders).
find -type d -name node_modules -prune -exec rm -rf {} \+ \
|| fail "Unable to delete node_modules."
status "[4/4] Cleaning the npm cache."
npm cache clean -f || fail "Unable to clean npm cache."