From 76cd9d61ebefef34d524132f83e05d14a25d26f3 Mon Sep 17 00:00:00 2001 From: Alexander Presber Date: Wed, 8 May 2013 00:52:35 +0200 Subject: [PATCH] proposed fix for https://github.com/alexeypetrushin/vos/issues/1 allow empty home because some servers allow SFTP access (now SSH shell) only --- lib/vos/drivers/ssh.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/vos/drivers/ssh.rb b/lib/vos/drivers/ssh.rb index 7d0ef9e..39e8ed5 100644 --- a/lib/vos/drivers/ssh.rb +++ b/lib/vos/drivers/ssh.rb @@ -106,8 +106,7 @@ def home unless @home command = 'cd ~; pwd' code, stdout, stderr = exec command - raise "can't execute '#{command}'!" unless code == 0 - @home = stdout.gsub("\n", '') + @home = code == 0 ? stdout.gsub("\n", '') : '' end @home end @@ -138,4 +137,4 @@ def hacked_exec!(ssh, command, merge_stdout_and_stderr = false, &block) end end end -end \ No newline at end of file +end