refactoring the common parts of the release scripts

This commit is contained in:
Dustin Carlino 2019-08-05 13:08:49 -07:00
parent c82413fca5
commit 9b96ef69da
3 changed files with 26 additions and 29 deletions

20
release/common.sh Executable file
View File

@ -0,0 +1,20 @@
function common_release {
OUT=$1;
rm -rfv $OUT
mkdir $OUT
cp docs/INSTRUCTIONS.md $OUT
mkdir $OUT/data
cp data/color_scheme.json $OUT/data
mkdir $OUT/data/maps
for map in 23rd ballard caphill downtown montlake; do
cp -v data/maps/$map.bin $OUT/data/maps/
mkdir -p $OUT/data/scenarios/$map
cp -v data/scenarios/$map/psrc* $OUT/data/scenarios/$map/
done
mkdir $OUT/data/shapes
cp -v data/shapes/popdat.bin $OUT/data/shapes
}

View File

@ -8,22 +8,10 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
OUT=abstreet_mac OUT=abstreet_mac
fi fi
rm -rfv $OUT source release/common.sh
mkdir $OUT common_release $OUT
cp docs/INSTRUCTIONS.md release/play_abstreet.sh $OUT cp release/play_abstreet.sh $OUT
mkdir $OUT/data
cp data/color_scheme.json $OUT/data
mkdir $OUT/data/maps
for map in 23rd ballard caphill downtown montlake; do
cp -v data/maps/$map.bin $OUT/data/maps/
mkdir -p $OUT/data/scenarios/$map
cp -v data/scenarios/$map/psrc* $OUT/data/scenarios/$map/
done
mkdir $OUT/data/shapes
cp -v data/shapes/popdat.bin $OUT/data/shapes
mkdir $OUT/editor mkdir $OUT/editor
cargo build --release --bin editor cargo build --release --bin editor

View File

@ -4,22 +4,11 @@
set -e set -e
OUT=abstreet_windows OUT=abstreet_windows
rm -rfv $OUT
mkdir $OUT
cp docs/INSTRUCTIONS.md release/play_abstreet.bat $OUT source release/common.sh
mkdir $OUT/data common_release $OUT
cp data/color_scheme.json $OUT/data
mkdir $OUT/data/maps cp release/play_abstreet.bat $OUT
for map in 23rd ballard caphill downtown montlake; do
cp -v data/maps/$map.bin $OUT/data/maps/
mkdir -p $OUT/data/scenarios/$map
cp -v data/scenarios/$map/psrc* $OUT/data/scenarios/$map/
done
mkdir $OUT/data/shapes
cp -v data/shapes/popdat.bin $OUT/data/shapes
mkdir $OUT/editor mkdir $OUT/editor
cross build --release --target x86_64-pc-windows-gnu --bin editor cross build --release --target x86_64-pc-windows-gnu --bin editor