MCPcopy Index your code
hub / github.com/devspace-sh/devspace / makeTar

Function makeTar

pkg/devspace/hook/upload.go:95–104  ·  view source on GitHub ↗
(srcPath, destPath string, writer io.Writer)

Source from the content-addressed store, hash-verified

93}
94
95func makeTar(srcPath, destPath string, writer io.Writer) error {
96 gw := gzip.NewWriter(writer)
97 defer gw.Close()
98 tarWriter := tar.NewWriter(gw)
99 defer tarWriter.Close()
100
101 srcPath = path.Clean(srcPath)
102 destPath = path.Clean(destPath)
103 return recursiveTar(path.Dir(srcPath), path.Base(srcPath), path.Dir(destPath), path.Base(destPath), tarWriter)
104}
105
106func recursiveTar(srcBase, srcFile, destBase, destFile string, tw *tar.Writer) error {
107 srcPath := path.Join(srcBase, srcFile)

Callers 1

uploadFunction · 0.85

Calls 2

recursiveTarFunction · 0.70
CloseMethod · 0.65

Tested by

no test coverage detected