Skip to content

Commit

Permalink
(chocolatey-archiveGH-374) Cleanup download statement
Browse files Browse the repository at this point in the history
This originally was based on chocolatey-archiveGH-375, but this closes chocolatey-archiveGH-375.

Nobody really needs to know where the file was downloaded to unless they are
debugging the output, only where the file is coming from. And cleaning up in
the same way that Redsandro suggested.
  • Loading branch information
ferventcoder committed Mar 2, 2014
1 parent a876e9b commit a579b65
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/helpers/functions/Get-ChocolateyWebFile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,20 @@ param(
$url = $url32bit
}

Write-Host "Downloading $packageName $bitPackage bit ($url) to $fileFullPath"
#$downloader = new-object System.Net.WebClient
#$downloader.DownloadFile($url, $fileFullPath)
if ($url.StartsWith('http')) {
Get-WebFile $url $fileFullPath
Write-Host "Downloading $packageName $bitPackage bit
from `'$url`'"
Get-WebFile $url $fileFullPath
} elseif ($url.StartsWith('ftp')) {
Write-Host "Ftp-ing $packageName
from `'$url`'"
Get-FtpFile $url $fileFullPath
} else {
if ($url.StartsWith('file:')) { $url = ([uri] $url).LocalPath }
Write-Debug "We are attempting to copy the local item `'$url`' to `'$fileFullPath`'"
Write-Host "Copying $packageName
from `'$url`'"
Copy-Item $url -Destination $fileFullPath -Force
}

Expand Down

0 comments on commit a579b65

Please sign in to comment.