Warning: Division by zero in /.2/vhosts/www.friendlinkup.com/html/nonsense.php on line 340

Warning: Division by zero in /.2/vhosts/www.friendlinkup.com/html/nonsense.php on line 342
Ruby script to remove svn folders
raulsimoninib's Blog
O Yang do Ying, não o contrário.. RSS Feed - Newest 10 Posts Add To Favourites

Ruby script to remove svn folders
Posted on 2009-03-18 by raulsimoninib

This code is so useful as well as pretty easy too when we desire to remove recursively recursive the .svn folders from a project we desire to send.

The credit of the original code is @HelgeG guy

This was only enhanced to manufacture a warning first as well as count the kills, still under testing.


require 'find'
require 'fileutils'

puts "nttt! WARNING !nnYou are about to remove .SVN from this folder as well as all sub-folders"
puts "# This program is to be used on a backup folder, no way back! nCONTINUE?"
resp = gets

if resp.include?('s') || resp.include?('y')
	i = 0
	Find.find('./') do |path|
	  if File.basename(path) == '.svn'
		FileUtils.remove_dir(path, true)
		i += 1
		Find.prune
	  end
	end
	puts "#{i} .svn folders were deleted in conjunction with their juice.."
	sleep 3
end
puts "Bye"
sleep 1

Use on your posses Risk!

feed | tags: desenvolvimento, ruby, script, svn


del.icio.us digg Fark YahooMyWeb Reddit Furl NewsVine Spurl BlinkList blogmarks

<<< Back