summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/popen.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/gitlab/popen.rb b/lib/gitlab/popen.rb
index 2f30fde2078..5283cf0b821 100644
--- a/lib/gitlab/popen.rb
+++ b/lib/gitlab/popen.rb
@@ -1,9 +1,15 @@
+require 'fileutils'
+
module Gitlab
module Popen
def popen(cmd, path)
vars = { "PWD" => path }
options = { chdir: path }
+ unless File.directory?(path)
+ FileUtils.mkdir_p(path)
+ end
+
@cmd_output = ""
@cmd_status = 0
Open3.popen3(vars, cmd, options) do |stdin, stdout, stderr, wait_thr|