提交 da34e008 编写于 作者: D Dmitriy Zaporozhets

Merge pull request #5294 from dalehamel/master

Ensure directory exists before changing in popen
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|
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册