Skip to content

Instantly share code, notes, and snippets.

@Plastickid
Forked from premitheme/README.md
Created April 30, 2022 16:54
Show Gist options
  • Save Plastickid/49387cf5a1d9566574513c2543c0a1fe to your computer and use it in GitHub Desktop.
Save Plastickid/49387cf5a1d9566574513c2543c0a1fe to your computer and use it in GitHub Desktop.
Create automator service to clean zip files

Clean Zip Service for Mac

In Automator create new workflow with the following settings

Service recieves selected: files or folders in: Finder.app

Run Shell Script

Shell: /bin/bash Pass input: to stdin

while read -r p; do
  zip -d "$p" "__MACOSX/*" || true
  zip -d "$p" "*.DS_Store" || true
  zip -d "$p" "*.git/*" || true
  zip -d "$p" "*.gitignore" || true
  zip -d "$p" "*.sass-cache/*" || true
  zip -d "$p" "*.codekit-cache/*" || true
  zip -d "$p" "*.codekit" || true
  zip -d "$p" "*.codekit3" || true
done

Then save this as service with the name "Clean Zip".

To clean any zip file, right click on it, go to services -> Clean Zip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment