OSX bash function and alias to remove hidden directories from zip files
$ 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
This comment has been minimized.
Run from terminal and specify the zip file to process:
$ dsclean files.zip
You can also use OSX apps like Keka and YemuZip