Created
August 10, 2010 18:55
-
-
Save chrisk/517775 to your computer and use it in GitHub Desktop.
Rails initializer to remove old submodules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Git doesn't remove submodules from your working tree when you pull. This Rails | |
# initializer will take care of it for you, so developers don't have to do | |
# anything. | |
paths = %w(vendor/gems/first_gem-1.0.0 | |
vendor/gems/another_gem-1.0.0) | |
paths.each do |path| | |
dir = Rails.root.join(path) | |
if File.directory?(dir) | |
puts "Automatically deleting #{dir.sub(Rails.root.to_s + '/', '')}, since it's an old submodule that we removed" | |
FileUtils.rm_rf dir | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment