justinnichols.com

Snow Leopard – Automator – Remove .svn and .DS_Store

by justin on Jul.12, 2010, under Apple, Programming

Here are the shell scripts for removing .svn and .DS_Store when using an Automator Service script. Just make sure to set the service receive selected to pass files/folders and to do so “As Arguments”.

.svn

for f in "$@"
do
find "$f" -name .svn -print0 | xargs -0 chflags -R nouchg
find "$f" -name .svn -print0 | xargs -0 rm -fr
done

.DS_Store

for f in "$@"
do
find "$f" -name .DS_Store -print0 | xargs -0 rm -fr
done

Now once you save the scripts, you will have a right click contextual item in Finder for folders/files to be able to remove .svn folders and .DS_Store files. I suggest these two scripts be two separate automator workflows and not combined.


Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Blogroll

A few highly recommended websites...

Archives

All entries, chronologically...