mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-21 01:37:15 +03:00
d999a21ac3
The output of `cd` might be altered by `CDPATH` set on a system, leading to `dade` being broken because it cannot read the current path. Instead, using `readlink -f` seem to get the job done without side effects.
18 lines
497 B
Bash
Executable File
18 lines
497 B
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# Compute the size of the development environment closure
|
|
#
|
|
DADE_CURRENT_SCRIPT_DIR="$( dirname $( readlink -f "${BASH_SOURCE[0]}" ) )"
|
|
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
|