extractBinary pulls out the snix / snix.exe from the downloaded archive. Returns the absolute path of the extracted binary inside tmpDir.
(archivePath, dest string)
| 223 | // extractBinary pulls out the snix / snix.exe from the downloaded archive. |
| 224 | // Returns the absolute path of the extracted binary inside tmpDir. |
| 225 | func 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 | |
| 232 | func extractTarGz(path, dest string) (string, error) { |
| 233 | f, err := os.Open(path) |
no test coverage detected