Skip to content

Commit

Permalink
#1 ignore .ssh if exists
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Dec 10, 2016
1 parent cc1cb77 commit d43850f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion objects/exec.rb
Expand Up @@ -33,6 +33,8 @@ def initialize(*rest)
def run
system(@cmd)
status = $CHILD_STATUS.to_i
raise "Exit code (#{status}) is not zero" unless status.zero?
return if status.zero?
puts @cmd
raise "Exit code (#{status}) is not zero"
end
end
2 changes: 1 addition & 1 deletion objects/git_repo.rb
Expand Up @@ -72,10 +72,10 @@ def pull

def prepare
dir = "#{Dir.home}/.ssh"
return if File.exist?(dir)
FileUtils.mkdir_p(dir)
priv = "#{dir}/id_rsa"
IO.write(priv, @id_rsa) unless @id_rsa.empty?
return if File.exist?("#{dir}/config")
Exec.new(
'set -x;',
'set -e;',
Expand Down
2 changes: 1 addition & 1 deletion test/test_0pdd.rb
Expand Up @@ -42,7 +42,7 @@ def test_it_renders_home_page
def test_it_understands_push_from_github
post(
'/hook/github',
'{"repository":{"full_name":"yegor256/0pdd"}}',
'{"repository":{"full_name":"teamed/pdd"}}',
'CONTENT_TYPE' => 'application/json'
)
assert last_response.ok?
Expand Down

0 comments on commit d43850f

Please sign in to comment.