@@ -26,38 +26,28 @@ function moveToTrash () {
26
26
done
27
27
}
28
28
29
-
29
+ RED=' \033[0;31m'
30
+ GREEN=' \033[0;32m'
31
+ BOLD=' \033[1m'
32
+ NORMAL=' \033[0m'
30
33
if [[ ! -f /Applications/Xcode.app/Contents/MacOS/Xcode ]]; then
31
- echo " Xcode is needed to build V2RayX, Please install Xcode from App Store!"
32
- echo " 编译 V2RayX 需要 Xcode.app,请从 App Store 里安装 Xcode."
34
+ echo " ${RED} Xcode is needed to build V2RayX, Please install Xcode from App Store!${NORMAL} "
35
+ echo " ${RED} 编译 V2RayX 需要 Xcode.app,请从 App Store 里安装 Xcode.${NORMAL} "
33
36
else
34
- echo " -- downloading source code --"
35
- echo " -- 正在下载源码 --"
37
+ echo " ${BOLD} -- Downloading source code --${NORMAL} "
38
+ echo " ${BOLD} -- 正在下载源码 --${NORMAL} "
36
39
git clone --recursive https://github.com/Cenmrev/V2RayX.git
37
40
cd V2RayX
38
- echo " -- start building V2RayX --"
39
- echo " -- 开始编译 V2RayX --"
41
+ echo " ${BOLD} -- Start building V2RayX --${NORMAL} "
42
+ echo " ${BOLD} -- 开始编译 V2RayX --${NORMAL} "
40
43
xcodebuild -project V2RayX.xcodeproj -target V2RayX -configuration Release
41
44
if [[ $? == 0 ]]; then
42
- echo " -- build succeeded --"
43
- echo " -- 编译成功 --"
44
- echo " Move V2RayX.app to the folder /Applications or not? 是否将编译得到的 V2RayX.app 移到应用程序文件夹?(yes/no)"
45
- read -r a
46
- if [[ $a == " yes" ]]; then
47
- moveToTrash /Applications/V2RayX.app # delete old version
48
- mv ./build/Release/V2RayX.app /Applications/
49
- echo " Delete source codes or not? 是否删除下载的源码?(yes/no)"
50
- read -r a
51
- if [[ $a == " yes" ]]; then
52
- cd ..
53
- moveToTrash V2RayX
54
- fi
55
- else
56
- echo " V2RayX.app: $( pwd) /build/Release/V2RayX.app"
57
- fi
45
+ echo " ${GREEN} -- Build succeeded --${NORMAL} "
46
+ echo " ${GREEN} -- 编译成功 --${NORMAL} "
47
+ echo " ${BOLD} V2RayX.app: $( pwd) /build/Release/V2RayX.app${NORMAL} "
58
48
else
59
- echo " -- build failed --"
60
- echo " -- 编译失败 --"
49
+ echo " ${RED} -- Build failed --${NORMAL} "
50
+ echo " ${RED} -- 编译失败 --${NORMAL} "
61
51
fi
62
52
fi
63
53
0 commit comments