36 строки
1005 B
PowerShell
36 строки
1005 B
PowerShell
|
cd $PSScriptRoot
|
||
|
|
||
|
$repoFolder = $PSScriptRoot
|
||
|
$env:REPO_FOLDER = $repoFolder
|
||
|
|
||
|
$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip"
|
||
|
if ($env:KOREBUILD_ZIP)
|
||
|
{
|
||
|
$koreBuildZip=$env:KOREBUILD_ZIP
|
||
|
}
|
||
|
|
||
|
$buildFolder = ".build"
|
||
|
$buildFile="$buildFolder\KoreBuild.ps1"
|
||
|
|
||
|
if (!(Test-Path $buildFolder)) {
|
||
|
Write-Host "Downloading KoreBuild from $koreBuildZip"
|
||
|
|
||
|
$tempFolder=$env:TEMP + "\KoreBuild-" + [guid]::NewGuid()
|
||
|
New-Item -Path "$tempFolder" -Type directory | Out-Null
|
||
|
|
||
|
$localZipFile="$tempFolder\korebuild.zip"
|
||
|
|
||
|
Invoke-WebRequest $koreBuildZip -OutFile $localZipFile
|
||
|
Add-Type -AssemblyName System.IO.Compression.FileSystem
|
||
|
[System.IO.Compression.ZipFile]::ExtractToDirectory($localZipFile, $tempFolder)
|
||
|
|
||
|
New-Item -Path "$buildFolder" -Type directory | Out-Null
|
||
|
copy-item "$tempFolder\**\build\*" $buildFolder -Recurse
|
||
|
|
||
|
# Cleanup
|
||
|
if (Test-Path $tempFolder) {
|
||
|
Remove-Item -Recurse -Force $tempFolder
|
||
|
}
|
||
|
}
|
||
|
|
||
|
&"$buildFile" $args
|