Last active
August 29, 2015 14:20
-
-
Save jsteenkamp/3eaf62895cf69c77b865 to your computer and use it in GitHub Desktop.
OSX bash function and alias to remove hidden directories from zip files
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
$ nano ~/.bash_rc | |
function dsclean() { | |
if [ -f $1 ] | |
then | |
echo "Delete __MACOSX folder from $1" | |
zip -d "$1" __MACOSX* | |
echo "Delete all .DS_Store folders from $1" | |
zip -d "$1" \*.DS_Store | |
fi | |
} | |
----- | |
$ nano ~/.bash_profile | |
if [ -f ~/.bash_rc ] | |
then . ~/.bash_rc | |
fi | |
alias dsclean='dsclean'; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run from terminal and specify the zip file to process:
$ dsclean files.zip
You can also use OSX apps like Keka and YemuZip