MCPcopy Index your code
hub / github.com/jetify-com/devbox / Compress

Function Compress

internal/pullbox/tar/tar.go:54–69  ·  view source on GitHub ↗
(dir string)

Source from the content-addressed store, hash-verified

52}
53
54func Compress(dir string) (string, error) {
55 tmpDir, err := fileutil.CreateDevboxTempDir()
56 if err != nil {
57 return "", err
58 }
59 target := filepath.Join(tmpDir, "archive.tar.gz")
60 cmd := cmdutil.CommandTTY("tar", "-czf", target, ".")
61
62 cmd.Dir = dir
63
64 if err = cmd.Start(); err != nil {
65 return "", errors.WithStack(err)
66 }
67
68 return target, nil
69}

Callers 1

PushFunction · 0.92

Calls 2

CreateDevboxTempDirFunction · 0.92
CommandTTYFunction · 0.92

Tested by

no test coverage detected