daml/dev-env/bin/dade-closure-size
Digital Asset GmbH 05e691f558 open-sourcing daml
2019-04-04 09:33:38 +01:00

18 lines
497 B
Bash
Executable File

#!/usr/bin/env bash
#
# Compute the size of the development environment closure
#
DADE_CURRENT_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
PATHS=$DADE_CURRENT_SCRIPT_DIR/../var/gc-roots/*/
for bin in $PATHS; do
NAME=$(basename $bin)
CLO=$(nix-store -qR $bin)
SIZE=$(du -shc $CLO | tail -1 | awk '{ print $1 }')
printf "%-20s: %s\n" $NAME $SIZE
done
TOTAL=$(du -shc $(nix-store -qR $PATHS) | tail -1 | awk '{ print $1 }')
echo
printf "%-20s: %s\n" "grand total" $TOTAL