forked from avibrazil/RDM
-
Notifications
You must be signed in to change notification settings - Fork 75
/
install
executable file
·37 lines (32 loc) · 928 Bytes
/
install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
[[ -z $RDM_PATH ]] && RDM_PATH='/Applications'
read -p "Install RDM to ${RDM_PATH}? (Y/n): " __doInstall
while [[ -z $__flag ]]; do
case "$__doInstall" in
[Yy]*|'')
__flag=true
;;
[Nn]* )
exit 1
;;
* )
read -p "Please type y or n: " __doInstall
;;
esac
done
osascript -e 'quit app "RDM"'
__tempdir=$(mktemp -d) 2>&1 > /dev/null
__ERR_LOG="
$(xcodebuild -archivePath "${__tempdir}/RDM" -scheme RDM archive 2>&1 > /dev/null)
$(xcodebuild -exportArchive -archivePath "${__tempdir}/RDM.xcarchive" -exportPath "$RDM_PATH" -exportOptionsPlist etc/export.plist 2>&1 > /dev/null)"
if [[ $? = 0 ]]; then
rm -rf "$__tempdir" &>/dev/null
open "${RDM_PATH}/RDM.app"
echo "Build finished!"
else
rm -rf "$__tempdir" &>/dev/null
echo "
An error occured; try again
${__ERR_LOG}"
exit 100
fi