Skip to content

Commit

Permalink
Added warning if password is prompted for and termios is not installed
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.rubyonrails.org/rails/tools/capistrano@5227 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
jamis committed Oct 5, 2006
1 parent b1d7041 commit 41c9def
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
@@ -1,5 +1,7 @@
*SVN*

* Added warning if password is prompted for and termios is not installed [John Labovitz]

* Added :as option to sudo, so you can specify who the command is executed as [Mark Imbriaco]

*1.2.0* (September 14, 2006)
Expand Down
10 changes: 5 additions & 5 deletions lib/capistrano/cli.rb
Expand Up @@ -16,11 +16,7 @@ def self.execute!
# This requires the termios library to be installed (which, unfortunately,
# is not available for Windows).
begin
if !defined?(USE_TERMIOS) || USE_TERMIOS
require 'termios'
else
raise LoadError
end
require 'termios'

# Enable or disable stdin echoing to the terminal.
def self.echo(enable)
Expand All @@ -43,6 +39,10 @@ def self.echo(enable)
# if termios is not available, echo suppression will not be available
# either.
def self.with_echo
unless @warned_about_echo
puts "WARNING: Password will echo -- install the 'termios' gem to hide your password." if !defined?(Termios) && RUBY_PLATFORM !~ /mswin/
@warned_about_echo = true
end
echo(false)
yield
ensure
Expand Down

0 comments on commit 41c9def

Please sign in to comment.