mirror of
https://github.com/capistrano/capistrano
synced 2023-03-27 23:21:18 -04:00
Merge pull request #791 from jage/improve-console
Improve console (EOF and empty commands)
This commit is contained in:
commit
1a4b654b87
1 changed files with 9 additions and 1 deletions
|
@ -4,7 +4,15 @@ task :console do
|
|||
puts I18n.t('console.welcome', scope: :capistrano, stage: stage)
|
||||
loop do
|
||||
print "#{stage}> "
|
||||
command = $stdin.gets.chomp
|
||||
|
||||
if input = $stdin.gets
|
||||
command = input.chomp
|
||||
else
|
||||
command = 'exit'
|
||||
end
|
||||
|
||||
next if command.empty?
|
||||
|
||||
if %w{quit exit q}.include? command
|
||||
puts t('console.bye')
|
||||
break
|
||||
|
|
Loading…
Reference in a new issue