File tree 1 file changed +12
-10
lines changed
1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -44,36 +44,38 @@ install_sfml() {
44
44
45
45
main () {
46
46
# Select option
47
+
47
48
echo " Where do you want to install the visualizer?"
48
- echo " 1.- Compile and leave the executable in this folder "
49
- echo " 2.- Compile and move the executable into /usr/bin"
49
+ echo " 1.- Compile and leave the executable in this directory "
50
+ echo " 2.- Compile and move the executable into /usr/bin (requires root) "
50
51
echo " "
51
52
read -n 1 -p " Option: " option
52
53
echo " "
53
54
echo " "
54
55
55
- # Compile
56
+ # 1: Compile
56
57
if [ " $option " = " 1" ]; then
57
58
compile
58
59
59
60
echo " Done!"
60
61
exit
61
62
62
- # Compile and move binary to /usr/bin
63
+ # 2: Compile and move binary to /usr/bin
63
64
elif [ " $option " = " 2" ]; then
64
- # Check if has been runned as sudo
65
- if [ " $EUID " -ne 0 ]
66
- then echo " Please, run as root! (sudo ./install.sh)"
67
- exit
68
- fi
69
65
70
66
compile
71
67
72
68
# Move executable to /usr/bin
73
69
echo Moving executable into /usr/bin...
74
- mv ./sorting-visualizer /usr/bin
70
+ sudo mv ./sorting-visualizer /usr/bin
75
71
echo Done!
76
72
exit
73
+
74
+ # -: Not a valid option
75
+ else
76
+ echo " Select a valid option!"
77
+ exit
78
+
77
79
fi
78
80
}
79
81
You can’t perform that action at this time.
0 commit comments