mirror of
https://github.com/capistrano/capistrano
synced 2023-03-27 23:21:18 -04:00
Added warning if password is prompted for and termios is not installed
git-svn-id: http://svn.rubyonrails.org/rails/tools/capistrano@5227 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
5702172560
commit
6f70c9e7a3
2 changed files with 7 additions and 5 deletions
|
@ -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)
|
||||
|
|
|
@ -16,11 +16,7 @@ module Capistrano
|
|||
# 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)
|
||||
|
@ -43,6 +39,10 @@ module Capistrano
|
|||
# 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue