Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed default setting of ssh_key

* If Config#ssh_key is set check if the file exist otherwise fail with error message
* If Config#ssh_key is not set check if default ssh_key path exists and use
* that one if it exists
  • Loading branch information...
commit 244764dffd3a6f1bd52c03de2938c3a014633a7c 1 parent 7a08e6d
arvida authored
Showing with 6 additions and 2 deletions.
  1. +0 −1  lib/teleport/config.rb
  2. +6 −1 lib/teleport/main.rb
View
1  lib/teleport/config.rb
@@ -20,7 +20,6 @@ def initialize(file = "Telfile")
@user ||= Util.whoami
@ruby ||= RUBIES.first
- @ssh_key ||= "#{ENV["HOME"]}/.ssh/#{PUBKEY}"
sanity_check_gemfiles
end
View
7 lib/teleport/main.rb
@@ -86,7 +86,12 @@ def assemble_tgz
f.puts("CONFIG_RUBYGEMS='#{RUBYGEMS}'")
end
# keys
- ssh_key = @config.ssh_key
+ if ssh_key = @config.ssh_key
+ if !File.exists?(ssh_key)
+ fatal("I can't find the specified ssh key: #{ssh_key}")
+ end
+ end
+ ssh_key ||= "#{ENV["HOME"]}/.ssh/#{PUBKEY}"
if File.exists?(ssh_key)
run("cp", [ssh_key, "#{DIR}/#{PUBKEY}"])
end
Please sign in to comment.
Something went wrong with that request. Please try again.