lib/meroku/cli.rb in meroku-2.0.1 vs lib/meroku/cli.rb in meroku-2.0.2
- old
+ new
@@ -113,10 +113,10 @@
end
name = "id_rsa.pub"
data = `cat ~/.ssh/id_rsa.pub`.chomp
url = "https://www.meroku.com/publickeys.json"
token = `cat ~/.meroku/.token`.chomp
- response_json = RestClient.post url, {:publickey=>{:name => nam, :data=>data}, :token=>token}.to_json, timeout: 1, :content_type => :json, :accept => :json
+ response_json = RestClient.post url, {:publickey=>{:name => name, :data=>data}, :token=>token}.to_json, timeout: 1, :content_type => :json, :accept => :json
if JSON.parse(response_json)["errors"] && JSON.parse(response_json)["errors"].size > 0
puts JSON.parse(response_json)["errors"].map{|x| x["detail"]}.join(".")
else
name = JSON.parse(response_json)["data"]["attributes"]["name"]