Skip to content

Commit

Permalink
Fixing build for macos
Browse files Browse the repository at this point in the history
  • Loading branch information
dosaki committed Aug 11, 2024
1 parent 0ee2015 commit e141cd2
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,18 @@ zip -r ${DIST}/analyser.zip .
cd ${DIR}
# rm -rf ${BUILD}

size=`du -b dist/analyser.zip | awk '{print $1}'`
unix_type=$(uname -a | awk '{ print $1 }')
if [[ "${unix_type}" == "Darwin" ]]; then
size=`stat -f%z ./dist/analyser.zip`
else
size=`du -b ./dist/analyser.zip | awk '{print $1}'`
fi

leftover=$((size - 13312))
if [[ $((size - 13312)) -gt 0 ]]; then
echo -e "\e[93m\e[1m[WARNING] TOO BIG! File size is ${size}. You need to lose $leftover bytes.\e[39m"
echo -e "\033[93m\033[1m[WARNING] TOO BIG! File size is ${size}. You need to lose $leftover bytes.\033[39m"
exit 1
else
echo -e "\e[92m\e[1m[SUCCESS] File size under 13312 bytes: ${size}. You have $((-leftover)) bytes left.\e[39m"
echo -e "\033[92m\033[1m[SUCCESS] File size under 13312 bytes: ${size}. You have $((-leftover)) bytes left.\033[39m"
exit 0
fi

0 comments on commit e141cd2

Please sign in to comment.