MCPcopy
hub / github.com/hashicorp/go-getter / Decompress

Method Decompress

decompress_tar.go:165–183  ·  view source on GitHub ↗
(dst, src string, dir bool, umask os.FileMode)

Source from the content-addressed store, hash-verified

163}
164
165func (d *TarDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error {
166 // If we're going into a directory we should make that first
167 mkdir := dst
168 if !dir {
169 mkdir = filepath.Dir(dst)
170 }
171 if err := os.MkdirAll(mkdir, mode(0755, umask)); err != nil {
172 return err
173 }
174
175 // File first
176 f, err := os.Open(src)
177 if err != nil {
178 return err
179 }
180 defer f.Close()
181
182 return untar(f, dst, src, dir, umask, d.FileSizeLimit, d.FilesLimit)
183}

Callers

nothing calls this directly

Calls 4

modeFunction · 0.85
untarFunction · 0.85
DirMethod · 0.65
CloseMethod · 0.45

Tested by

no test coverage detected