forked from ubisoft/Sharpmake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextract-vcpkg.ps1
38 lines (36 loc) · 927 Bytes
/
extract-vcpkg.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
param ([string] $workingDirectory)
try
{
Write-Host "--- Bootstrap for vcpkg ---"
# change working folder if one was given
if($workingDirectory -ne "")
{
Push-Location -Path $workingDirectory
if (-not $?)
{
throw "error when changing working dir : $LASTEXITCODE"
}
}
$currentDir = Get-Location
Write-Host "working folder : $currentDir"
# clean zip dest folder if exists
if (Test-Path extern\vcpkg)
{
Remove-Item extern\vcpkg -Recurse -Force
}
#unzip vcpkg
Write-Host "extracting extern\vcpkg.zip to extern\vcpkg"
Expand-Archive extern\vcpkg.zip -DestinationPath extern
#back to latest working folder
if($workingDirectory -ne "")
{
Pop-Location
$currentDir = Get-Location
Write-Host "working folder : $currentDir"
}
}
catch
{
Write-Error $PSItem.Exception
exit 1
}