summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-10-31 17:26:16 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-10-31 17:26:16 +0000
commit634482d165ee5759206c42692a6857a588e63007 (patch)
tree741b2a828579bc5ece9d50a81da3a0ba0beca6d6 /lib
parent4a76eddedc950086db5cbed9fb53c70a0e04ca09 (diff)
parent8d6807098ffbe9492dbf1de2a7d9620bdeb348e3 (diff)
downloadgitlab-shell-634482d165ee5759206c42692a6857a588e63007.tar.gz
Merge branch 'puts_instead_of_echo' of /home/git/repositories/gitlab/gitlab-shell
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab_keys.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/gitlab_keys.rb b/lib/gitlab_keys.rb
index dc54740..2ea5117 100644
--- a/lib/gitlab_keys.rb
+++ b/lib/gitlab_keys.rb
@@ -29,9 +29,8 @@ class GitlabKeys
def add_key
$logger.info "Adding key #{@key_id} => #{@key.inspect}"
- cmd = "command=\"#{ROOT_PATH}/bin/gitlab-shell #{@key_id}\",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty #{@key}"
- cmd = "echo \'#{cmd}\' >> #{auth_file}"
- system(cmd)
+ auth_line = "command=\"#{ROOT_PATH}/bin/gitlab-shell #{@key_id}\",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty #{@key}"
+ open(auth_file, 'a') { |file| file.puts(auth_line) }
end
def rm_key