Skip to content

Instantly share code, notes, and snippets.

@wrr
Created July 3, 2018 10:58
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 wrr/d12b9363cd3e046e6ac948b65072b3ab to your computer and use it in GitHub Desktop.
Save wrr/d12b9363cd3e046e6ac948b65072b3ab to your computer and use it in GitHub Desktop.
Decompresses all compressed files in a Shapespark bundle
#!/bin/sh
if [ $# != 1 ]; then
echo "usage: $0 path-to-bundle-dir";
exit;
fi
bundle_dir=${1}
echo "Uncompressing files in ${bundle_dir}"
for file in `find ${bundle_dir} -type f`;
do
echo "Checking if ${file} is compressed"
gzip -l ${file} 2>/dev/null 1>/dev/null;
if [ $? -eq 0 ]; then
echo "Uncompressing ${file}"
mv ${file} ${file}.gz
gunzip ${file}.gz
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment