Permalink
Browse files

stupid fix for syntax error

  • Loading branch information...
1 parent 4550688 commit 705e7e6946efe5927bec95800992cb4729f542ef Travis Boettcher committed Dec 21, 2011
Showing with 14 additions and 9 deletions.
  1. +14 −9 bin/scala-bootstrapper
View
@@ -92,15 +92,20 @@ Dir["#{root}/**/*"].select{|path| File.file?(path)}.each do |path|
template = ERB.new(content, nil, nil, "@output")
target_path = gsub_birds(relative, project_name, namespace).sub(/\.erb$/, '')
if File.exists?(target_path) && !$overwrite_all
- print "File exists `#{relative}`, replace? ([Y]es, [N]o, [A]ll, [Q]uit)"
- $stdout.flush
- case STDIN.gets
- when /^y/i: # continue
- when /^n/i: next
- when /^a/i: $overwrite_all = true
- when /^q/i: exit(2)
- else
- retry
+ acceptable_answer = false
+ while !acceptable_answer
+ print "File exists `#{relative}`, replace? ([Y]es, [N]o, [A]ll, [Q]uit)"
+ $stdout.flush
+ case STDIN.gets
+ when /^y/i
+ acceptable_answer = true
+ when /^n/i
+ next
+ when /^a/i
+ $overwrite_all = true
+ when /^q/i
+ exit(2)
+ end
end
end
puts "writing #{target_path}"

1 comment on commit 705e7e6

You may want overwrite_all to be an acceptable_answer as well.

Please sign in to comment.