Merge pull request #15146 from kolyshkin/mkdirall
Simplify and fix MkdirAll usage Upstream-commit: 8d2739df980a1af76ad50e5c423134815186b61c Component: engine
This commit is contained in:
@@ -720,7 +720,7 @@ func (archiver *Archiver) CopyWithTar(src, dst string) error {
|
||||
}
|
||||
// Create dst, copy src's content into it
|
||||
logrus.Debugf("Creating dest directory: %s", dst)
|
||||
if err := system.MkdirAll(dst, 0755); err != nil && !os.IsExist(err) {
|
||||
if err := system.MkdirAll(dst, 0755); err != nil {
|
||||
return err
|
||||
}
|
||||
logrus.Debugf("Calling TarUntar(%s, %s)", src, dst)
|
||||
@@ -752,7 +752,7 @@ func (archiver *Archiver) CopyFileWithTar(src, dst string) (err error) {
|
||||
dst = filepath.Join(dst, filepath.Base(src))
|
||||
}
|
||||
// Create the holding directory if necessary
|
||||
if err := system.MkdirAll(filepath.Dir(dst), 0700); err != nil && !os.IsExist(err) {
|
||||
if err := system.MkdirAll(filepath.Dir(dst), 0700); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user