Permalink
Browse files

The force option works.

  • Loading branch information...
1 parent 6bf22a2 commit 24dcf22d913091df2be115bdcbbac65a0fb975a7 @brian-c committed Mar 11, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/grabass.rb
View
@@ -42,9 +42,14 @@ def grab(destination_root, options = {})
# TODO: Do this check before fetching things.
if File.exists? absolute_destination and not options[:force]
- puts Grabass::indent "#{destination} already exists! Use --force to replace", '!'
+ puts Grabass::indent "#{destination} already exists. Use --force to replace.", '!'
results[:fail] += 1
else
+ if File.exists? absolute_destination
+ puts Grabass::indent "Replacing existing #{destination}", '!' unless options[:quiet]
+ FileUtils.remove_entry absolute_destination, true
+ end
+
Dir.chdir temp_dir
selected_files = Dir.glob(pattern)

0 comments on commit 24dcf22

Please sign in to comment.