mirror of
https://github.com/docker/cli.git
synced 2026-09-25 17:02:07 -04:00
Merge pull request #15146 from kolyshkin/mkdirall
Simplify and fix MkdirAll usage Upstream-commit: 8d2739df980a1af76ad50e5c423134815186b61c Component: engine
This commit is contained in:
@@ -1187,7 +1187,7 @@ func newFakeGit(name string, files map[string]string, enforceLocalServer bool) (
|
||||
// Call c.Fatal() at the first error.
|
||||
func writeFile(dst, content string, c *check.C) {
|
||||
// Create subdirectories if necessary
|
||||
if err := os.MkdirAll(path.Dir(dst), 0700); err != nil && !os.IsExist(err) {
|
||||
if err := os.MkdirAll(path.Dir(dst), 0700); err != nil {
|
||||
c.Fatal(err)
|
||||
}
|
||||
f, err := os.OpenFile(dst, os.O_CREATE|os.O_RDWR|os.O_TRUNC, 0700)
|
||||
|
||||
Reference in New Issue
Block a user