Skip to content

Commit ae4c393

Browse files
committed
update run.sh
1 parent 9215396 commit ae4c393

File tree

1 file changed

+43
-9
lines changed

1 file changed

+43
-9
lines changed

run.sh

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#!/bin/bash
2-
echo "-- ███████╗██╗░░░░░██╗░░░██╗██████╗░███████╗███╗░░██╗--"
3-
echo "-- ██╔════╝██║░░░░░╚██╗░██╔╝██╔══██╗██╔════╝████╗░██║--"
4-
echo "-- █████╗░░██║░░░░░░╚████╔╝░██████╔╝█████╗░░██╔██╗██║--"
5-
echo "-- ██╔══╝░░██║░░░░░░░╚██╔╝░░██╔═══╝░██╔══╝░░██║╚████║--"
6-
echo "-- ██║░░░░░███████╗░░░██║░░░██║░░░░░███████╗██║░╚███║--"
7-
echo "-- ╚═╝░░░░░╚══════╝░░░╚═╝░░░╚═╝░░░░░╚══════╝╚═╝░░╚══╝--"
2+
83
#is macos
4+
echo "---- C++ Course Design ----"
95

6+
CORES=$(nproc)
7+
#最多使用
8+
echo "-- Using $CORES cores."
9+
CORES=$((CORES-1))
1010
spin() {
1111
local -a spinner=( "" "" "" "" "" "" "" "" "" "" )
1212
local str=$1
@@ -18,7 +18,32 @@ spin() {
1818
done
1919
done
2020
}
21-
21+
#检测是否可以执行dg_ctl命令
22+
if [ ! -x "$(command -v dg_ctl)" ]; then
23+
echo "-- drogon does not exist, downloading..."
24+
git submodule update --init
25+
cd drogon
26+
mkdir build
27+
cd build
28+
cmake ..
29+
echo "-- make -j$CORES"
30+
make -j$CORES
31+
echo $1 | sudo -S make install
32+
cd ../..
33+
fi
34+
#检测/usr/local/include/jwt-cpp/jwt.h是否存在
35+
if [ ! -f "/usr/local/include/jwt-cpp/jwt.h" ]; then
36+
echo "-- jwt-cpp does not exist, downloading..."
37+
git submodule update --init
38+
cd jwt-cpp
39+
mkdir build
40+
cd build
41+
cmake ..
42+
echo "-- make -j$CORES"
43+
make -j$CORES
44+
echo $1 | sudo -S make install
45+
cd ../..
46+
fi
2247

2348
if [ "$(uname)" == "Darwin" ]; then
2449
echo "-- Macos detected"
@@ -64,14 +89,23 @@ fi
6489
echo "-- build folder already exists "
6590
fi
6691
# 获取机器的核心数
67-
CORES=$(nproc)
68-
echo "Using $CORES cores."
6992
CORES=$((CORES-1))
7093
cd build
7194
cmake ..
7295
make clean
7396
echo "-- make -j$CORES"
7497
make -j$CORES
98+
echo
99+
echo "======================================================="
100+
echo "-- ███████╗██╗░░░░░██╗░░░██╗██████╗░███████╗███╗░░██╗--"
101+
echo "-- ██╔════╝██║░░░░░╚██╗░██╔╝██╔══██╗██╔════╝████╗░██║--"
102+
echo "-- █████╗░░██║░░░░░░╚████╔╝░██████╔╝█████╗░░██╔██╗██║--"
103+
echo "-- ██╔══╝░░██║░░░░░░░╚██╔╝░░██╔═══╝░██╔══╝░░██║╚████║--"
104+
echo "-- ██║░░░░░███████╗░░░██║░░░██║░░░░░███████╗██║░╚███║--"
105+
echo "-- ╚═╝░░░░░╚══════╝░░░╚═╝░░░╚═╝░░░░░╚══════╝╚═╝░░╚══╝--"
106+
echo "======================================================="
107+
echo
108+
sleep 1
75109
echo "-- Working in the background..."
76110
spin "Running ..." &
77111
SPIN_PID=$!

0 commit comments

Comments
 (0)