-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcompile
executable file
·34 lines (26 loc) · 1.05 KB
/
compile
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
#!/bin/bash
# CONFIG
if [ -z "$1" ]; then
export AVALAM_COMPILE_ENV="dev"
else
export AVALAM_COMPILE_ENV=$1
fi
rm ./.DS_Store 2> /dev/null
rm */.DS_Store 2> /dev/null
rm */*/.DS_Store 2> /dev/null
rm */*/*/.DS_Store 2> /dev/null
version=$(cat config/compile_version_base)
suffix=$(cat config/compile_version_suffix)
suffix=$(($suffix+1))
log_compile_path="logs/compile.logs"
echo "Compilation de 'build/$AVALAM_COMPILE_ENV-$version.$suffix.exe'..."
echo "[$(date)] ++ Compilation de 'build/$AVALAM_COMPILE_ENV-$version.$suffix.exe' ..." >> $log_compile_path
g++ src/main.cpp src/classes/*/*.class.cpp -o build/$AVALAM_COMPILE_ENV-$version.$suffix.exe -Wall
if [ $? -eq 0 ]; then
echo $suffix > config/compile_version_suffix
echo "build/$AVALAM_COMPILE_ENV-$version.$suffix.exe" > config/last_version
echo "Compilation réussie"
fi
git add $log_compile_path build/$AVALAM_COMPILE_ENV-$version.$suffix.exe > /dev/null 2> /dev/null
git commit -m "Compilation de 'build/dev-$version.$suffix.exe' ..." > /dev/null 2> /dev/null
git push > /dev/null 2> /dev/null &