2014-08-14 12:26:10 +00:00
|
|
|
set -o errexit
|
|
|
|
set -o pipefail
|
|
|
|
|
2015-01-27 13:04:34 +00:00
|
|
|
if [[ $NODE_ENV == 'production' ]]; then
|
2015-02-20 13:36:45 +00:00
|
|
|
# Remove node-gyp cache
|
|
|
|
rm -rf ~/.node-gyp/
|
|
|
|
# Remove cached git deps
|
|
|
|
rm -rf /tmp/*
|
2014-08-07 20:47:36 +00:00
|
|
|
# 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
|
2014-08-07 21:23:01 +00:00
|
|
|
# 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
|
2015-01-06 14:37:34 +00:00
|
|
|
# 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
|
2014-08-01 15:20:58 +00:00
|
|
|
fi
|