Skip to content

Commit e4ce7e4

Browse files
committed
add build_client_clean.sh, bash script equivalent of build_client_clean.bat
1 parent b3281e5 commit e4ce7e4

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

Artifacts/build_client_clean.sh

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/bin/bash
2+
3+
basepath=$(cd "$(dirname "$0")" && pwd)
4+
echo "$basepath"
5+
cd "$basepath"
6+
7+
mkdir -p ../build_client/Client/public
8+
mkdir -p ../build_client/Client/src/common
9+
mkdir -p ../build_client/Client/src/modules
10+
mkdir -p ../build_client/Client/src/dialogs
11+
mkdir -p ../build_client/Client/dist
12+
13+
cp ../Client/public/* ../build_client/Client/public/ 2>/dev/null || true
14+
cp ../Client/src/*.* ../build_client/Client/src/ 2>/dev/null || true
15+
cp ../Client/src/common/* ../build_client/Client/src/common/ 2>/dev/null || true
16+
cp ../Client/src/modules/* ../build_client/Client/src/modules/ 2>/dev/null || true
17+
cp ../Client/src/dialogs/* ../build_client/Client/src/dialogs/ 2>/dev/null || true
18+
cp ../Client/*.js ../build_client/Client/ 2>/dev/null || true
19+
cp ../Client/*.json ../build_client/Client/ 2>/dev/null || true
20+
21+
cd ..
22+
git log -n 1 --format="%H" -- "Client" > "build_client/Client/dist/_githash_client.txt"
23+
git log -n 1 --format="%H" -- "Client" > "Artifacts/clientdist/_githash_client.txt"
24+
CLIENTDIRHASH=$(cat "build_client/Client/dist/_githash_client.txt")
25+
26+
cat > build_client/Client/src/AMCGitHash.js <<EOF
27+
export function getClientGitHash ()
28+
{
29+
return "$CLIENTDIRHASH";
30+
}
31+
EOF
32+
33+
cd build_client/Client
34+
35+
npm install
36+
npm run build
37+
38+
cd ../..
39+
40+
cd build_client/Client
41+
42+
go run ../../BuildScripts/createClientDist.go dist ../../Artifacts/clientdist/clientpackage.zip
43+
44+
go run ../../BuildScripts/createClientSource.go . ../../Artifacts/clientdist/clientsourcepackage.zip
45+
46+
echo
47+
echo "Created packages in Artifacts/clientdist/:"
48+
ls -l ../../Artifacts/clientdist
49+
echo
50+
51+
exit 0

0 commit comments

Comments
 (0)