require 'find' require 'fileutils' Find.find('./') do |path| if File.basename(path) == '.svn' FileUtils.remove_dir(path, true) Find.prune end end
Never been to CodeSnippets before?
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)
Recursively remove .svn directories (ruby script) (See related posts)
Comments on this post
#!/bin/sh for FILE in `find . -type d -name .svn`; do echo $FILE rm -r $FILE done
find . -type d -name .svn | xargs rm -rf
</code?
find . -type d -name .svn -exec rm -rf {} \;
the "-exec rm -rf {} \;" block tells find to execute "rm -rf" for a match (it replaces {} with the filename), and the "\;" is necessary to let the -exec switch know where the command passing stops.
You need to create an account or log in to post comments to this site.
Related Posts
» Bulk svn actions (usefull wi... in ruby rails svn subversion
» Make a subversion release in ruby svn subversion release trunk repo repository
» update a working copy and al... in ruby shell svn subversion
» create a rails app from rail... in ruby rails shell svn bash subversion rubyonrails
» Add missing empty directorie... in ruby rsync svn subversion
» knowning how many commits it... in svn subversion
Snippets (source code soon to be available) developed by Peter Cooper and powered by Ruby On Rails