Skip to content

Commit f98f4a9

Browse files
authored
Merge pull request #858 from shuuuuun/fix/file_collision_help
Fix help for file_collision method without block
2 parents ada161b + 40bccb0 commit f98f4a9

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

lib/thor/shell/basic.rb

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def file_collision(destination)
316316

317317
say "Please specify merge tool to `THOR_MERGE` env."
318318
else
319-
say file_collision_help
319+
say file_collision_help(block_given?)
320320
end
321321
end
322322
end
@@ -384,16 +384,21 @@ def is?(value) #:nodoc:
384384
end
385385
end
386386

387-
def file_collision_help #:nodoc:
388-
<<-HELP
387+
def file_collision_help(block_given) #:nodoc:
388+
help = <<-HELP
389389
Y - yes, overwrite
390390
n - no, do not overwrite
391391
a - all, overwrite this and all others
392392
q - quit, abort
393-
d - diff, show the differences between the old and the new
394393
h - help, show this help
395-
m - merge, run merge tool
396394
HELP
395+
if block_given
396+
help << <<-HELP
397+
d - diff, show the differences between the old and the new
398+
m - merge, run merge tool
399+
HELP
400+
end
401+
help
397402
end
398403

399404
def show_diff(destination, content) #:nodoc:

0 commit comments

Comments
 (0)