Created
August 10, 2010 21:59
-
-
Save perlDreamer/518097 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
##Utility script for building merged wgpkg files for release. | |
echo "Building root node" | |
wgd package root | |
tar zxf root.wgpkg | |
mv 000001.json ../ | |
/bin/rm -f -- *.json *.storage root.wgpkg | |
mv ../000001.json . | |
echo "Unpacking and renaming assets from lineage to assetId based, for handling moves of assets" | |
#for file in `find ../packages-7.8.0 -name '*wgpkg' -print`; do \ | |
PACKAGE_DIRS=`ls -d -v ../packages-$1.*` | |
echo $PACKAGE_DIRS | |
for file in `find $PACKAGE_DIRS -name '*wgpkg' -print`; do \ | |
tar zxf $file; \ | |
for json in *.json; do \ | |
mv -- $json `perl -ne 'print $1 if /assetId. : .(\S{22})/;' -- $json`.pkg; | |
done | |
done | |
echo "Renaming from assetId back to lineage for packing" | |
for file in *.pkg; do \ | |
#echo -- $file `perl -ne 'print $1 if /lineage. : .(\d+)/;' -- $file`.json; | |
mv -- $file `perl -ne 'print $1 if /lineage. : .(\d+)/;' -- $file`.json; | |
done | |
echo "Packing up" | |
tar -czf merged.wgpkg -- *.json *.storage | |
echo "Cleaning up" | |
/bin/rm -f -- *.json *.storage |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment