#!/bin/bash
#
/bin/mkdir -p "${HOME}/Desktop/downloadfromjamf"
cd "${HOME}/Desktop/downloadfromjamf"
sysctl -n machdep.cpu.brand_string | grep -i Intel
if [ $? = 0 ];then
unzip -o "./PyCharm CE inter.zip"
else
/usr/bin/curl -o "./PyCharm CE m1.zip" http://aaa.bbb.com/util/software/PyCharm%20CE%20m1.zip #M1 or M2
unzip -o "./PyCharm CE m1.zip"
fi
chmod -R 777 "${HOME}/Desktop/downloadfromjamf"
sudo /bin/cp -a "./PyCharm CE.app" /Applications/
(/usr/bin/osascript -e 'display dialog "成功安装Pycharm,您可以删除桌面上的downloadfromjamf目录,如果打开Pycharm出现错误,请重启电脑!" buttons {"OK"} default button "OK"')
cd ../
#rm -Rf "${HOME}/Desktop/downloadfromjamf"
exit 0