aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/VcpkgPowershellUtils.ps112
-rw-r--r--scripts/fetchDependency.ps13
2 files changed, 7 insertions, 8 deletions
diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1
index d431c3b45..0e53ff620 100644
--- a/scripts/VcpkgPowershellUtils.ps1
+++ b/scripts/VcpkgPowershellUtils.ps1
@@ -19,7 +19,7 @@ function vcpkgCreateParentDirectoryIfNotExists([Parameter(Mandatory=$true)][stri
return
}
- if (!(Test-Path $dirPath))
+ if (!(Test-Path $parentDir))
{
New-Item -ItemType Directory -Path $parentDir | Out-Null
}
@@ -157,9 +157,7 @@ function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$file,
[Parameter(Mandatory=$true)][string]$destinationDir)
{
vcpkgCreateParentDirectoryIfNotExists $destinationDir
- $baseName = (Get-ChildItem $file).BaseName
- $destination = "$destinationDir\$baseName"
- $destinationPartial = "$destination-partially_extracted"
+ $destinationPartial = "$destinationDir-partially_extracted"
vcpkgRemoveDirectory $destinationPartial
vcpkgCreateDirectoryIfNotExists $destinationPartial
@@ -192,12 +190,12 @@ function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$file,
{
Move-Item -Path "$destinationPartial\*" -Destination $destinationDir
vcpkgRemoveDirectory $destinationPartial
- return $destination
+ return $destinationDir
}
else
{
- Rename-Item -Path $destinationPartial -NewName $baseName
- return $destination
+ Move-Item -Path $destinationPartial -Destination $destinationDir
+ return $destinationDir
}
}
diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1
index 744439bb7..830ec7064 100644
--- a/scripts/fetchDependency.ps1
+++ b/scripts/fetchDependency.ps1
@@ -88,7 +88,8 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency)
{
if (-not (Test-Path $executableFromDownload))
{
- vcpkgExtractFile -File $downloadPath -DestinationDir $downloadsDir
+ $extractFolderName = (Get-ChildItem $downloadPath).BaseName
+ vcpkgExtractFile -File $downloadPath -DestinationDir "$downloadsDir\$extractFolderName"
}
}
elseif($extractionType -eq $ExtractionType_SELF_EXTRACTING_7Z)