MCPcopy Create free account
hub / github.com/SamNet-dev/snix / extractBinary

Function extractBinary

cmd/snix/update.go:225–230  ·  view source on GitHub ↗

extractBinary pulls out the snix / snix.exe from the downloaded archive. Returns the absolute path of the extracted binary inside tmpDir.

(archivePath, dest string)

Source from the content-addressed store, hash-verified

223// extractBinary pulls out the snix / snix.exe from the downloaded archive.
224// Returns the absolute path of the extracted binary inside tmpDir.
225func extractBinary(archivePath, dest string) (string, error) {
226 if strings.HasSuffix(archivePath, ".zip") {
227 return extractZip(archivePath, dest)
228 }
229 return extractTarGz(archivePath, dest)
230}
231
232func extractTarGz(path, dest string) (string, error) {
233 f, err := os.Open(path)

Callers 1

newUpdateCmdFunction · 0.85

Calls 2

extractZipFunction · 0.85
extractTarGzFunction · 0.85

Tested by

no test coverage detected