MCPcopy Index your code
hub / github.com/apache/devlake / CreateGZipArchive

Function CreateGZipArchive

backend/core/utils/io.go:43–54  ·  view source on GitHub ↗

CreateGZipArchive creates a tar archive, compresses it with gzip and writes the files/directories associated with the `sourcePaths` to it. If a sourcePath directory ends with /*, then its contents are copied over, but not the directory itself

(archivePath string, sourcePaths ...string)

Source from the content-addressed store, hash-verified

41// CreateGZipArchive creates a tar archive, compresses it with gzip and writes the files/directories associated with the `sourcePaths` to it.
42// If a sourcePath directory ends with /*, then its contents are copied over, but not the directory itself
43func CreateGZipArchive(archivePath string, sourcePaths ...string) errors.Error {
44 err := createArchive("tar", archivePath, sourcePaths...)
45 if err != nil {
46 return err
47 }
48 // now gzip it
49 err = toGzip(archivePath)
50 if err != nil {
51 return errors.Default.Wrap(err, "error compressing archive to gzip")
52 }
53 return nil
54}
55
56func createArchive(archiveType string, archivePath string, sourcePaths ...string) errors.Error {
57 for _, sourcePath := range sourcePaths {

Callers

nothing calls this directly

Calls 3

createArchiveFunction · 0.85
toGzipFunction · 0.85
WrapMethod · 0.80

Tested by

no test coverage detected