Updater: push-update.sh: Make it work on macOS
Change-Id: I2bb51e349961efb1738d1abac2eaad9d3b4b9ad0
diff --git a/push-update.sh b/push-update.sh
index ee6e833..be5d137 100755
--- a/push-update.sh
+++ b/push-update.sh
@@ -39,8 +39,13 @@
version=`echo "$zip_name" | cut -d'-' -f2`
type=`echo "$zip_name" | cut -d'-' -f4`
build_date=`echo "$zip_name" | cut -d'-' -f3 | cut -d'_' -f1`
-timestamp=`date --date="$build_date 23:59:59" +%s`
-size=`stat -c "%s" "$zip_path"`
+if [[ "`uname`" == "Darwin" ]]; then
+ timestamp=`date -jf "%Y%m%d %H:%M:%S" "$build_date 23:59:59" +%s`
+ size=`stat -f%z "$zip_path"`
+else
+ timestamp=`date --date="$build_date 23:59:59" +%s`
+ size=`stat -c "%s" "$zip_path"`
+fi
adb push "$zip_path" "$zip_path_device"
adb shell chgrp cache "$zip_path_device"