diff options
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/VcpkgPowershellUtils.ps1 | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 0b1a35262..d32c3ae6b 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -3,7 +3,7 @@ function vcpkgHasModule([Parameter(Mandatory=$true)][string]$moduleName) return [bool](Get-Module -ListAvailable -Name $moduleName) } -function vcpkgCreateDirectory([Parameter(Mandatory=$true)][string]$dirPath) +function vcpkgCreateDirectoryIfNotExists([Parameter(Mandatory=$true)][string]$dirPath) { if (!(Test-Path $dirPath)) { @@ -102,7 +102,7 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, } $downloadDir = split-path -parent $downloadPath - vcpkgCreateDirectory $downloadDir + vcpkgCreateDirectoryIfNotExists $downloadDir $downloadPartPath = "$downloadPath.part" vcpkgRemoveFile $downloadPartPath @@ -144,12 +144,12 @@ function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$file, [Parameter(Mandatory=$true)][string]$destinationDir) { $parentPath = split-path -parent $destinationDir - vcpkgCreateDirectory $parentPath + vcpkgCreateDirectoryIfNotExists $parentPath $baseName = (Get-ChildItem $file).BaseName $destinationPartial = "$destinationDir\$baseName-partially_extracted" vcpkgRemoveDirectory $destinationPartial - vcpkgCreateDirectory $destinationPartial + vcpkgCreateDirectoryIfNotExists $destinationPartial if (vcpkgHasCommand -commandName 'Microsoft.PowerShell.Archive\Expand-Archive') { |
