Merge pull request 'packaging/visualizations.sh: Made compatible with Linux too' (#99) from 20220321_fixed_visualizations.sh_for_Linux into main
Reviewed-on: https://git.robur.io/robur/builder-web/pulls/99
This commit is contained in:
commit
c82e94805e
1 changed files with 22 additions and 3 deletions
|
@ -78,8 +78,17 @@ FILENAME="${1}"
|
||||||
CACHE_DIR="${CACHE}/${UUID}"
|
CACHE_DIR="${CACHE}/${UUID}"
|
||||||
BUILDER_VIZ="builder-viz"
|
BUILDER_VIZ="builder-viz"
|
||||||
|
|
||||||
TMPTREE=$(mktemp -t treevis)
|
mktemp_aux () {
|
||||||
TMPOPAM=$(mktemp -t opamvis)
|
if [ "$(uname)" = "Linux" ]; then
|
||||||
|
mktemp -t "$1.XXX"
|
||||||
|
elif [ "$(uname)" = "FreeBSD" ]; then
|
||||||
|
mktemp -t "$1"
|
||||||
|
else
|
||||||
|
echo 'Unsupported platform'; exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
TMPTREE=$(mktemp_aux treeviz)
|
||||||
|
TMPOPAM=$(mktemp_aux opamviz)
|
||||||
cleanup () {
|
cleanup () {
|
||||||
rm -rf "${TMPTREE}" "${TMPOPAM}"
|
rm -rf "${TMPTREE}" "${TMPOPAM}"
|
||||||
}
|
}
|
||||||
|
@ -94,7 +103,17 @@ else
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SIZE="$(stat -f "%z" ${FILENAME})"
|
stat_aux () {
|
||||||
|
if [ "$(uname)" = "Linux" ]; then
|
||||||
|
stat -c "%s" "$1"
|
||||||
|
elif [ "$(uname)" = "FreeBSD" ]; then
|
||||||
|
stat -f "%z" "$1"
|
||||||
|
else
|
||||||
|
echo 'Unsupported platform'; exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
SIZE="$(stat_aux ${FILENAME})"
|
||||||
|
|
||||||
if [ ! -z "${DEBUG}" ]; then
|
if [ ! -z "${DEBUG}" ]; then
|
||||||
if [ -e "${CACHE_DIR}.treemap.html" ]; then
|
if [ -e "${CACHE_DIR}.treemap.html" ]; then
|
||||||
|
|
Loading…
Reference in a new issue