Skip to content

Commit

Permalink
Strip query parameters when determining filename
Browse files Browse the repository at this point in the history
Signed-off-by: gscho <greg.c.schofield@gmail.com>
  • Loading branch information
gscho committed Mar 17, 2021
1 parent 4380052 commit 2dc8254
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# $filetype: Type of the file downloaded.
############

filename=`echo $download_url | sed -e 's/^.*\///'`
filename=`echo $download_url | sed -e 's/^.*\///' | sed -e 's/?.*//'`
filetype=`echo $filename | sed -e 's/^.*\.//'`

# use either $tmp_dir, the provided directory (-d) or the provided filename (-f)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function Install-Project {

$cached_installer_available = $false
$verify_checksum = $true

if (-not [string]::IsNullOrEmpty($download_url_override)) {
$download_url = $download_url_override
$sha256 = $checksum
Expand All @@ -91,7 +91,7 @@ function Install-Project {
}
}
else {
$filename = ($download_url -split '/')[-1]
$filename = (([System.Uri]$download_url).AbsolutePath -split '/')[-1]
}
Write-Verbose "Download directory: $download_directory"
Write-Verbose "Filename: $filename"
Expand Down

0 comments on commit 2dc8254

Please sign in to comment.