Skip to content

Instantly share code, notes, and snippets.

@perlDreamer
Created August 10, 2010 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save perlDreamer/518097 to your computer and use it in GitHub Desktop.
Save perlDreamer/518097 to your computer and use it in GitHub Desktop.
#!/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