diff --git a/opensca/walk/tar.go b/opensca/walk/tar.go index 7571ddc2..9bf34ab3 100644 --- a/opensca/walk/tar.go +++ b/opensca/walk/tar.go @@ -61,6 +61,7 @@ func xtar(ctx context.Context, filter ExtractFileFilter, input, output string) b continue } + os.MkdirAll(filepath.Dir(fp), 0777) fw, err := os.Create(fp) if err != nil { logs.Warn(err) @@ -94,7 +95,6 @@ func xgz(input, output string) bool { defer fr.Close() fp := filepath.Join(output, strings.TrimSuffix(filepath.Base(input), filepath.Ext(input))) - os.MkdirAll(filepath.Dir(fp), 0777) fw, err := os.Create(fp) if err != nil { logs.Warn(err)