Browse Source

Update compile.sh

add file num to 5.
check file existence.
if cpp not exist, then check py, if py not exist either, compile failed.
tags/0.1.0
xiangmy21 GitHub 2 years ago
parent
commit
f19be03086
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 6 deletions
  1. +10
    -6
      dependency/shell/compile.sh

+ 10
- 6
dependency/shell/compile.sh View File

@@ -3,15 +3,19 @@
i=1
flag=1
bind=/usr/local/mnt
while (( $i <= 4 ))
while (( $i <= 5 ))
do
mv -f $bind/player$i.cpp ./API/src/AI.cpp
cmake ./CMakeLists.txt && make >compile_log$i.txt 2>&1
mv ./capi $bind/capi$i # executable file
if [ $? -ne 0 ]; then
if [ -f "${bind}/player${i}.cpp" ]; then
cp -f $bind/player$i.cpp ./API/src/AI.cpp
cmake ./CMakeLists.txt && make >compile_log$i.txt 2>&1
mv ./capi $bind/capi$i # executable file
if [ $? -ne 0 ]; then
flag=0
fi
mv ./compile_log$i.txt $bind/compile_log$i.txt
elif [ ! -f "${bind}/player${i}.py" ]; then
flag=0
fi
mv ./compile_log$i.txt $bind/compile_log$i.txt
let "i++"
done
# HTML request to update status.


Loading…
Cancel
Save