lib/travis/cli/sshkey.rb in travis-1.7.1.travis.613.5 vs lib/travis/cli/sshkey.rb in travis-1.7.1

- old
+ new

@@ -50,16 +50,17 @@ warn "no key found to remove" end def generate_key github.with_basic_auth do |gh| + login = gh['user']['login'] check_access(gh) empty_line say "Generating RSA key." private_key = Tools::SSLKey.generate_rsa - self.description ||= "key for fetching dependencies for #{slug}" + self.description ||= "key for fetching dependencies for #{slug} via #{login}" say "Uploading public key to GitHub." gh.post("/user/keys", :title => "#{description} (Travis CI)", :key => Tools::SSLKey.rsa_ssh(private_key.public_key)) say "Uploading private key to Travis CI." @@ -73,10 +74,10 @@ end end end def remove_passphrase(value) - return unless Tools::SSLKey.has_passphrase? value + return value unless Tools::SSLKey.has_passphrase? value return Tools::SSLKey.remove_passphrase(value, passphrase) || error("wrong pass phrase") if passphrase error "Key is encrypted, but missing --passphrase option" unless interactive? say "The private key is protected by a pass phrase." result = Tools::SSLKey.remove_passphrase(value, ask("Enter pass phrase: ") { |q| q.echo = "*" }) until result empty_line