Skip to content

Commit

Permalink
Merge pull request #858 from shuuuuun/fix/file_collision_help
Browse files Browse the repository at this point in the history
Fix help for file_collision method without block
  • Loading branch information
rafaelfranca authored Aug 21, 2023
2 parents ada161b + 40bccb0 commit f98f4a9
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions lib/thor/shell/basic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def file_collision(destination)

say "Please specify merge tool to `THOR_MERGE` env."
else
say file_collision_help
say file_collision_help(block_given?)
end
end
end
Expand Down Expand Up @@ -384,16 +384,21 @@ def is?(value) #:nodoc:
end
end

def file_collision_help #:nodoc:
<<-HELP
def file_collision_help(block_given) #:nodoc:
help = <<-HELP
Y - yes, overwrite
n - no, do not overwrite
a - all, overwrite this and all others
q - quit, abort
d - diff, show the differences between the old and the new
h - help, show this help
m - merge, run merge tool
HELP
if block_given
help << <<-HELP
d - diff, show the differences between the old and the new
m - merge, run merge tool
HELP
end
help
end

def show_diff(destination, content) #:nodoc:
Expand Down

0 comments on commit f98f4a9

Please sign in to comment.