forked from rwmt/Multiplayer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
workshop_bundler.sh
27 lines (20 loc) · 960 Bytes
/
workshop_bundler.sh
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
#!/bin/bash
VERSION=$(grep -Po '(?<=Version = ")[0-9\.]+' Source/Common/Version.cs)
mkdir -p Multiplayer
cp -r About Languages Multiplayer/
sed -i "/<supportedVersions>/ a \ \ \ \ <li>1.1</li>" Multiplayer/About/About.xml
sed -i "/<supportedVersions>/ a \ \ \ \ <li>1.0</li>" Multiplayer/About/About.xml
sed -i "s/This is version .*\$/This is version ${VERSION}./" Multiplayer/About/About.xml
sed -i "s/<version>.*<\/version>\$/<version>${VERSION}<\/version>/" Multiplayer/About/Manifest.xml
rm -rf Multiplayer/1.2
mkdir -p Multiplayer/1.2
cp -r Assemblies Defs Multiplayer/1.2/
mkdir -p Multiplayer/1.1
git --work-tree=Multiplayer/1.1 checkout origin/rw-1.1 -- Assemblies Defs
git reset Assemblies Defs
mkdir -p Multiplayer/1.0
git --work-tree=Multiplayer/1.0 checkout origin/rw-1.0 -- Assemblies Defs
git reset Assemblies Defs
rm -f Multiplayer.zip
zip -r -q Multiplayer.zip Multiplayer
echo "Ok, $PWD/Multiplayer.zip ready for uploading to Workshop"