Skip to content

Commit

Permalink
include version in file names of packaged zips
Browse files Browse the repository at this point in the history
  • Loading branch information
sauerbraten committed Jun 26, 2022
1 parent c2ac835 commit 045b1b9
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions package_anticheat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,18 @@ function pack() {
target=$1
fi

# set version in source
cp src/p1xbraten/version.cpp src/p1xbraten/version.cpp.orig
local version=$(git describe)
sed -i "s/<git-dev>/$version/" src/p1xbraten/version.cpp

# make binaries
make $target

# restore git-dev version
rm src/p1xbraten/version.cpp
mv src/p1xbraten/version.cpp.orig src/p1xbraten/version.cpp

# create hash catalogue
local binDir="bin_unix"
local configFile="linux.cfg"
Expand All @@ -49,7 +58,6 @@ function pack() {
windows)
rm -f dist/p1xbraten_setup*
cp src/windows/p1xbraten.nsi src/windows/p1xbraten.nsi.orig
local version=$(git describe)
sed -i "s/<git-dev>/$version/" src/windows/p1xbraten.nsi
makensis src/windows/p1xbraten.nsi
mv p1xbraten_setup_* dist/
Expand All @@ -64,8 +72,8 @@ function pack() {
;& # fallthrough
*) # macos & linux
mkdir -p dist
rm -rf "dist/$platform.zip"
zip -r "dist/$platform.zip" "${files[@]}"
rm -rf "dist/$platform-$version.zip"
zip -r "dist/$platform-$version.zip" "${files[@]}"
;;
esac
}
Expand Down

0 comments on commit 045b1b9

Please sign in to comment.