1
0
Fork 0
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:
Tom Clements 2013-11-22 08:18:41 -08:00
commit 1a4b654b87

View file

@ -4,7 +4,15 @@ task :console do
puts I18n.t('console.welcome', scope: :capistrano, stage: stage) puts I18n.t('console.welcome', scope: :capistrano, stage: stage)
loop do loop do
print "#{stage}> " 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 if %w{quit exit q}.include? command
puts t('console.bye') puts t('console.bye')
break break