Skip to content

Commit

Permalink
Merge pull request #353 from gscho/strip-query-params
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Smith <tsmith@chef.io>
  • Loading branch information
tas50 authored Mar 17, 2021
2 parents 0d47045 + 2dc8254 commit 7f3cafd
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 7f3cafd

Please sign in to comment.