Skip to content

Commit

Permalink
fix get-remotefiles directory seperators
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCakeIsNaOH committed Jan 28, 2021
1 parent 3cbc4df commit f76208a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions AU/Public/Get-RemoteFiles.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ function Get-RemoteFiles {

if ($Purge) {
Write-Host 'Purging' $ext
Remove-Item -Force "$toolsPath\*.$ext" -ea ignore
$purgePath = "$toolsPath{0}*.$ext" -f [IO.Path]::DirectorySeparatorChar
Remove-Item -Force $purgePath -ea ignore
}

function headers($client) {
Expand All @@ -74,7 +75,7 @@ function Get-RemoteFiles {
headers($client)
$base_name = name4url $Latest.Url32
$file_name = "{0}{2}.{1}" -f $base_name, $ext, $(if ($NoSuffix) { '' } else {'_x32'})
$file_path = "$toolsPath\$file_name"
$file_path = Join-Path $toolsPath $file_name

Write-Host "Downloading to $file_name -" $Latest.Url32
$client.DownloadFile($Latest.URL32, $file_path)
Expand All @@ -87,7 +88,7 @@ function Get-RemoteFiles {
headers($client)
$base_name = name4url $Latest.Url64
$file_name = "{0}{2}.{1}" -f $base_name, $ext, $(if ($NoSuffix) { '' } else {'_x64'})
$file_path = "$toolsPath\$file_name"
$file_path = Join-Path $toolsPath $file_name

Write-Host "Downloading to $file_name -" $Latest.Url64
$client.DownloadFile($Latest.URL64, $file_path)
Expand Down

0 comments on commit f76208a

Please sign in to comment.