Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
83706fdc789e
Commit
da34e008
authored
Feb 04, 2014
by
Dmitriy Zaporozhets
Browse files
Merge pull request #5294 from dalehamel/master
Ensure directory exists before changing in popen
parents
f684aa2c0dea
45074049d490
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/gitlab/popen.rb
View file @
83706fdc
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
|
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment