Skip to content

Commit

Permalink
Treat download links as non-file URLs (#89)
Browse files Browse the repository at this point in the history
This allows the file-type determination to correctly ignore the fragment (part after the `#`) in the URL, plus it's more correct, since the URL *isn't* a file path.
  • Loading branch information
FuegoFro authored and rahul-malik committed Aug 19, 2019
1 parent 65b9c38 commit 4079ca6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/RepoToolsCore/RepoActions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ public enum RepoActions {
}

let downloadsDir = shell.tmpdir()
let url = NSURL(fileURLWithPath: urlString)
let url = NSURL(string: urlString)!
let fileName = url.lastPathComponent!
let download = downloadsDir + "/" + podName + "-" + fileName
guard let wwwUrl = NSURL(string: urlString).map({ $0 as URL }),
Expand Down Expand Up @@ -434,7 +434,7 @@ public enum RepoActions {
),
])
}
fatalError("Cannot extract files other than .zip, .tar, .tar.gz, or .tgz")
fatalError("Cannot extract files other than .zip, .tar, .tar.gz, or .tgz. Got \(lowercasedFileName)")
}

assertCommandOutput(extract(), message: "Extraction of \(podName) failed")
Expand Down

0 comments on commit 4079ca6

Please sign in to comment.