Skip to content

Commit 4112faa

Browse files
committed
create the @tmpdir_prefix if it doesn't exist
1 parent 05d4fcc commit 4112faa

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/entitlements/util/gitrepo.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,11 @@ def open3_git_execute(dir, commandline, ssh = false)
207207
# else custom that might be going on in the environment. Turn off prompts for the SSH key for
208208
# github.com being trusted or not, only use the provided key as the identity, and ignore any
209209
# ~/.ssh/config file the user running this might have set up.
210+
211+
# if the @tmpdir_prefix doesn't exist, create it
212+
FileUtils.mkdir_p(@tmpdir_prefix) unless File.directory?(@tmpdir_prefix)
210213
tempdir = Dir.mktmpdir(nil, @tmpdir_prefix)
214+
211215
File.open(File.join(tempdir, "key"), "w") { |f| f.write(sshkey) }
212216
File.open(File.join(tempdir, "ssh"), "w") do |f|
213217
f.puts "#!/bin/sh"

0 commit comments

Comments
 (0)