mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-19 05:37:53 +00:00
21 lines
952 B
Bash
Executable File
21 lines
952 B
Bash
Executable File
set -o errexit
|
|
set -o pipefail
|
|
|
|
if [[ $NODE_ENV == 'production' ]]; then
|
|
# Remove node-gyp cache
|
|
rm -rf ~/.node-gyp/
|
|
# Remove cached git deps
|
|
rm -rf /tmp/*
|
|
# Remove the c files we no longer need (the sqlite3 node module has a massive ~5M c file)
|
|
find . -name '*.c' -delete
|
|
# And the tar files (sqlite3 module again)
|
|
find . -name '*.tar.*' -delete
|
|
# Who needs tests and docs? Pffft! - Ignoring errors because find isn't a fan of us deleting directories whilst it's trying to search within them.
|
|
find . -type d -name 'test' -exec rm -rf '{}' \; 2> /dev/null || true
|
|
find . -type d -name 'doc' -exec rm -rf '{}' \; 2> /dev/null || true
|
|
find . -type d -name 'man' -exec rm -rf '{}' \; 2> /dev/null || true
|
|
# And any benchmark results (ttyjs->socket.io->socket.io-client->active-x-obfuscator->zeparser has an 8MB benchmark.html)
|
|
find . -type d -name 'benchmark*' -exec rm -rf '{}' \; 2> /dev/null || true
|
|
find . -name 'benchmark*' -delete
|
|
fi
|