ref: d44de147843af303298d1f893686894c6a4f0fa8
parent: 65d8a293dceaf150ab412a18ab4fcf602c5ba00b
author: cancel <cancel@cancel.fm>
date: Thu Nov 29 14:54:16 EST 2018
Fix file size stat in build tool on Mac
--- a/tool
+++ b/tool
@@ -86,6 +86,10 @@
last_time=
+file_size() {
+ wc -c < "$1" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//'
+}
+
timed_stats() {
if [[ $stats_enabled = 1 ]]; then
{ last_time=$( { time "$@" 1>&3- 2>&4-; } 2>&1 ); } 3>&1 4>&2
@@ -196,7 +200,7 @@
verbose_echo timed_stats "$compiler_exe" "${compiler_flags[@]}" -o "$out_path" "${source_files[@]}" ${libraries[@]+"${libraries[@]}"}
if [[ $stats_enabled = 1 ]]; then
echo "time: $last_time"
- stat -c "size: %s" -- "$out_path"
+ echo "size: $(file_size "$out_path")"
fi
}