This repository has been archived by the owner on Feb 21, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathconfig
executable file
·72 lines (65 loc) · 2.24 KB
/
config
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env bash
if [ $(id -u) -eq 0 ]; then
echo -e "\033[1;33m \n \nThis script mustn't be run as root!\n\033[0m"
exit 1
fi
configfile="./scripts/updater-preferences"
. ./scripts/config.shlib
if [ ! -x "$(command -v dialog)" ]; then
echo -e "\033[1;31mTerminal UI NOT supported! Install \"dialog\"! \033[0m"
exit 1
fi
exists=true
cfg_haskey $configfile version || exists=false
if [ "$exists" == false ]; then
echo Updating before changing config...
./update
fi
while true
do
response=$(dialog --keep-tite --title "Config" --menu "Select a config submenu:" 0 0 0 1 "Update channel" 2 "Build mode" 3 "CMake-GUI" --output-fd 1)
if [ "$response" == "" ]; then
break;
fi
if [ "$response" == 1 ]; then
response=$(dialog --keep-tite --title "Config" --menu "Select update channel" 0 0 0 1 "Stable (Recommended)" 2 "Master (Bleeding Edge)" 3 "Developer (Possible git issues, doesn't wipe modified files)" --output-fd 1)
if [ "$response" == 1 ]; then
cfg_write $configfile update_channel stable
elif [ "$response" == 2 ]; then
cfg_write $configfile update_channel master
elif [ "$response" == 3 ]; then
pushd scripts
./developer
popd
else
continue
fi
./update
elif [ "$response" == 2 ]; then
if [ ! -x "$(command -v cmake)" ]; then
dialog --keep-tite --title "Config" --msgbox "CMake is not installed!" 0 0
continue
fi
response=$(dialog --keep-tite --title "Config" --menu "Select build mode" 0 0 0 1 "Release (Performance)" 2 "Debug (Debug Symbols)" --output-fd 1)
if [ "$response" == 1 ]; then
pushd build
cmake -DCMAKE_BUILD_TYPE=Release ..
popd
elif [ "$response" == 2 ]; then
pushd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
popd
else
continue
fi
./update
elif [ "$response" == 3 ]; then
if [ ! -x "$(command -v cmake-gui)" ]; then
dialog --keep-tite --title "Config" --msgbox "CMake-GUI is not installed!" 0 0
continue
fi
pushd build
cmake-gui ..
popd
fi
done