-
Notifications
You must be signed in to change notification settings - Fork 0
/
zxXcode
executable file
·49 lines (44 loc) · 874 Bytes
/
zxXcode
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
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/local/bin/bash
declare -A xcodes
xcodes=(
[Xcode7.3.1]="/Applications/Xcode.app"
[Xcode8Beta]="/Applications/Xcode-beta.app"
[currentVersion]=""
[zquit]=""
)
chooseXcode()
{
echo ""
xcode=$1
echo -e "\e[1;33mXcodePath=${xcode}\e[0m"
sudo xcode-select -s ${xcode}
showCurrentViersion
}
showCurrentViersion()
{
echo ""
echo -e "\e[4;32mXcode version:\e[0m"
xcodebuild -version
echo ""
echo -e "\e[4;32mSwift version:\e[0m"
swift --version
}
mainFunction()
{
while [[ 1 ]]; do
echo ""
echo -e "\e[1;35mchoose one of Xcode blow:\e[0m"
select key in ${!xcodes[*]};
do
break
done
case $key in
Xcode7.3.1 ) chooseXcode ${xcodes[$key]};;
Xcode8Beta ) chooseXcode ${xcodes[$key]};;
currentVersion) showCurrentViersion ;;
zquit ) exit;;
*) echo "not correct input";;
esac
done
}
mainFunction