diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-11-26 01:31:58 -0800 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-11-26 01:31:58 -0800 |
| commit | 8883e40aaadbba91610342fda42d304a4cad0e68 (patch) | |
| tree | 551715bf4eea53de727d49cd07a8419b085d0e38 /scripts | |
| parent | 94bd9dd66e9db88f965c8b270ea58f927685a317 (diff) | |
| download | vcpkg-8883e40aaadbba91610342fda42d304a4cad0e68.tar.gz vcpkg-8883e40aaadbba91610342fda42d304a4cad0e68.zip | |
vcpkgCreateDirectory->vcpkgCreateDirectoryIfNotExists
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') { |
