-
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
makefile: enable db compression for releases
- Loading branch information
Showing
2 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
function compress() { | ||
if ! [ -f $1 ]; then return; fi | ||
|
||
if ! [ "$2" = "nc" ]; then | ||
sed 's/ --.*//g' -i $1 | ||
fi | ||
|
||
sed 's/ //g' -i $1 | ||
|
||
if [ "$2" = "ws" ]; then | ||
# even remove single whitespaces | ||
sed 's/ //g' -i $1 | ||
fi | ||
|
||
sed 's/ = /=/g' -i $1 | ||
tr -d '\n' < $1 > /tmp/$(basename $1) | ||
mv /tmp/$(basename $1) $1 | ||
} | ||
|
||
echo "===== compressing DB =====" | ||
echo "-> database" | ||
compress db/items.lua ws | ||
compress db/objects.lua ws | ||
compress db/units.lua ws | ||
compress db/quests.lua ws | ||
|
||
echo "-> locales" | ||
for loc in db/*/; do | ||
compress $loc/items.lua | ||
compress $loc/objects.lua | ||
compress $loc/professions.lua | ||
compress $loc/quests.lua nc | ||
compress $loc/units.lua | ||
compress $loc/zones.lua | ||
done |