Method: Toolshed::Commands::Base#read_user_input_password

Defined in:
lib/toolshed/commands/base.rb

#read_user_input_password(password, prompt_message = 'Password:') ⇒ Object



52
53
54
55
56
57
58
59
# File 'lib/toolshed/commands/base.rb', line 52

def read_user_input_password(password, prompt_message='Password:')
  return password unless password.nil? || password.empty?
  system "stty -echo"
  puts prompt_message
  value = $stdin.gets.chomp.strip
  system "stty echo"
  value
end