lib/retrospec/plugins/v1/module_helpers.rb in retrospec-0.3.1 vs lib/retrospec/plugins/v1/module_helpers.rb in retrospec-0.4.0
- old
+ new
@@ -16,9 +16,18 @@
FileUtils.mkdir_p dir
puts " + #{dir}/".info
end
end
+ def safe_move_file(src,dest)
+ if File.exists?(dest)
+ $stderr.puts "!! #{dest} already exists and differs from template".warning
+ else
+ FileUtils.mv(src,dest)
+ puts " + #{dest}".info
+ end
+ end
+
# copy the symlink and preserve the link
def safe_create_symlink(src,dest)
if File.exists? dest
$stderr.puts "!! #{dest} already exists and differs from template".warning
else