11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/fastlane/plugin/carthage_cache_ftps/helper/password_helper.rb', line 11
def password(host, username)
password = ENV["CARTHAGE_CACHE_FTPS_PASSWORD"]
unless password
item = Security::InternetPassword.find(server: server_name(host, username))
password = item.password if item
end
unless password
if !UI.interactive?
UI.error "Neither the CARTHAGE_CACHE_FTPS_PASSWORD environment variable nor the local keychain contained a password."
UI.error "Bailing out instead of asking for a password, since this is non-interactive mode."
UI.user_error!("Try setting the CARTHAGE_CACHE_FTPS_PASSWORD environment variable, or temporarily enable interactive mode to store a password.")
else
UI.important "Enter the passphrase that should be used to login to the ftps"
UI.important "This passphrase is specific per host and username and will be stored in your local keychain"
password = Fastlane::Helper::CarthageCacheFtpsHelper.ask_password(confirm: false)
store_password(host, username, password)
end
end
return password
end
|