Created
September 13, 2019 11:36
-
-
Save wpconsulate/6a5685854f2df838b897472ecd0fad4b to your computer and use it in GitHub Desktop.
Remove Mac System Files __MACOSX or .DS_Store from a folder or Git Repo
This file contains hidden or 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 | |
# remove __MACOSX foldr and .DS_Store files | |
# from *_original.zip file | |
# zip again and place under fixed/* | |
for x in $* | |
do | |
unzip $x | |
done | |
# remove mac foler | |
find . -name "__MACOSX" -exec rm -rv {} \; | |
# remove .DS_Store files | |
find . -name ".DS_Store" -exec rm -v {} \; | |
mkdir -p fixed/ | |
for x in $* | |
do | |
y=`echo ${x%%_original.zip}` | |
zip -r $y.zip $y | |
mv $y.zip fixed | |
rm -rv $y | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment