Updater: push-update.sh: Make it work on macOS

Change-Id: I2bb51e349961efb1738d1abac2eaad9d3b4b9ad0
This commit is contained in:
Mickey Knox 2020-03-05 13:11:39 +01:00 committed by Łukasz Patron
parent eabab0e94e
commit 416401aa2c

View File

@ -39,8 +39,13 @@ id=`echo "$zip_name" | sha1sum | cut -d' ' -f1`
version=`echo "$zip_name" | cut -d'-' -f2` version=`echo "$zip_name" | cut -d'-' -f2`
type=`echo "$zip_name" | cut -d'-' -f4` type=`echo "$zip_name" | cut -d'-' -f4`
build_date=`echo "$zip_name" | cut -d'-' -f3 | cut -d'_' -f1` build_date=`echo "$zip_name" | cut -d'-' -f3 | cut -d'_' -f1`
timestamp=`date --date="$build_date 23:59:59" +%s` if [[ "`uname`" == "Darwin" ]]; then
size=`stat -c "%s" "$zip_path"` 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 push "$zip_path" "$zip_path_device"
adb shell chgrp cache "$zip_path_device" adb shell chgrp cache "$zip_path_device"