Skip to content

Commit

Permalink
(GH-167) Get-ChocolateyWebFile create directory
Browse files Browse the repository at this point in the history
If the fileFullPath directory doesn't exist, create it.
  • Loading branch information
ferventcoder committed Mar 29, 2015
1 parent aa89825 commit 91f82d7
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,15 @@ param(
$checksumType = $checksumType64
}

try {
$fileDirectory = $([System.IO.Path]::GetDirectoryName($fileFullPath))
if (!(Test-Path($fileDirectory))) {
[System.IO.Directory]::CreateDirectory($fileDirectory) | Out-Null
}
} catch {
Write-Host "Attempt to create directory failed for '$fileFullPath'."
}

$forceX86 = $env:chocolateyForceX86;
if ($forceX86) {
Write-Debug "User specified -x86 so forcing 32 bit"
Expand Down

0 comments on commit 91f82d7

Please sign in to comment.