Created
July 3, 2018 10:58
-
-
Save wrr/d12b9363cd3e046e6ac948b65072b3ab to your computer and use it in GitHub Desktop.
Decompresses all compressed files in a Shapespark bundle
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/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