-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhelp.sh
More file actions
91 lines (90 loc) · 2.12 KB
/
help.sh
File metadata and controls
91 lines (90 loc) · 2.12 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/usr/bin/env bash
if [[ $1 = "clean" ]];
then
if test -d "build"
then
rm -rf build CMakeCache.txt cmake_install.cmake CMakeFiles ./bin/*
fi
if test -f "bin"
then
rm -r bin
fi
if test -f "r-type_server_autogen"
then
rm -r r-type_server_autogen
fi
exit
fi
if [[ $1 = "run_c" ]];
then
if test -f bin/r-type_client
then
./bin/r-type_client $2 $3
else
echo "No binary found, please build it with the \"build\" COMMAND."
echo "Would you like to do it now ? y/n"
read answer
if [[ $answer = "y" ]];
then
./help.sh build
./bin/r-type_client $2 $3
exit
fi
fi
exit
fi
if [[ $1 = "run_s" ]];
then
if test -f bin/r-type_server
then
./bin/r-type_server $2 $3 $4
else
echo "No binary found, please build it with the \"build\" COMMAND."
echo "Would you like to do it now ? y/n"
read answer
if [[ $answer = "y" ]];
then
./help.sh build
exit
fi
fi
exit
fi
if [[ $1 = "build" ]];
then
if test -d "build"
then
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release
cmake --build .
else
echo "No CONAN LIB found, please install them with the \"install\" COMMAND."
echo "Would you like to do it now ? y/n"
read answer
if [[ $answer = "y" ]];
then
./help.sh install
exit
fi
fi
exit
fi
if [[ $1 = "brun" ]];
then
./help.sh build
./help.sh run
exit
fi
if [[ $1 = "install" ]];
then
./help.sh clean
mkdir build
cd build
conan install .. --build=missing
cd ..
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release
cmake --build .
fi
if test -z $1
then
echo -e "Add a COMMAND next to the help.sh to execute it.\n\nEX: ./help COMMAND -> ./help install\n\nCOMMAND:\ninstall : clean and reinstall conan lib and Cmake cache.\nrun_s verbose==<bool> : run server on verbose true or false\nrun_c <ip server> : run client on <ip> server\nclean : clean conan lib and Cmake cache.\n"
fi