Use gdu on macOS

This commit is contained in:
Matthew Jorgensen 2022-03-23 21:41:18 -05:00
parent 24294b9095
commit 0b4dcc0be2
No known key found for this signature in database
GPG key ID: 5C3C6C19379A53AC

View file

@ -44,6 +44,13 @@ if [ "$#" -lt "2" ]
exit 1 exit 1
fi fi
# use gdu on macOS, fixes 'invalid option -b' error
if [ "$(uname -s)" = "Darwin" ]; then
DU_CMD=gdu
else
DU_CMD=du
fi
love_file=$1 love_file=$1
name=$2 name=$2
## confirm that $release_dir/$name-$version.love exists ## confirm that $release_dir/$name-$version.love exists
@ -70,7 +77,7 @@ love_version="11.4"
canvas_colour="54,69,79" canvas_colour="54,69,79"
text_colour="240,234,214" text_colour="240,234,214"
initial_memory=0 initial_memory=0
module_size=$(du -b $love_file | awk '{print $1}') module_size=$($DU_CMD -b $love_file | awk '{print $1}')
title=$(echo $name | sed -r 's/\<./\U&/g' | sed -r 's/-/\ /g') title=$(echo $name | sed -r 's/\<./\U&/g' | sed -r 's/-/\ /g')
version="" version=""
dash_version="" dash_version=""