| 496 | } |
| 497 | |
| 498 | func isArchive(path string) bool { |
| 499 | // As documented under the tarball type: |
| 500 | // https://nixos.org/manual/nix/unstable/command-ref/new-cli/nix3-flake#types |
| 501 | return strings.HasSuffix(path, ".tar") || |
| 502 | strings.HasSuffix(path, ".tar.gz") || |
| 503 | strings.HasSuffix(path, ".tgz") || |
| 504 | strings.HasSuffix(path, ".tar.xz") || |
| 505 | strings.HasSuffix(path, ".tar.zst") || |
| 506 | strings.HasSuffix(path, ".tar.bz2") || |
| 507 | strings.HasSuffix(path, ".zip") |
| 508 | } |
| 509 | |
| 510 | // splitPathOrOpaque splits a URL path by '/'. If the path is empty, it splits |
| 511 | // the opaque instead. Splitting happens before unescaping the path or opaque, |