Allow Haml --rails to (optionally) overwrite an existing vendor/plugins/haml dir.

This commit is contained in:
Nathan Weizenbaum 2008-05-24 12:13:36 -07:00
parent 5926e43df1
commit c349ce670d
1 changed files with 4 additions and 2 deletions

View File

@ -1,5 +1,6 @@
require File.dirname(__FILE__) + '/../haml'
require 'optparse'
require 'fileutils'
module Haml
# This module contains code for working with the
@ -128,8 +129,9 @@ END
dir = File.join(dir, 'haml')
if File.exists?(dir)
puts "Directory #{dir} already exists."
exit
print "Directory #{dir} already exists, overwrite [y/N]? "
exit if gets !~ /y/i
FileUtils.rm_rf(dir)
end
begin