forked from DevToys-app/DevToys
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.ps1
executable file
·28 lines (22 loc) · 1.06 KB
/
init.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
function ExecSafe([scriptblock] $cmd) {
& $cmd
if ($LASTEXITCODE) { exit $LASTEXITCODE }
}
Set-StrictMode -Version 2.0; $ErrorActionPreference = "Stop"; $ConfirmPreference = "None"; trap { Write-Error $_ -ErrorAction Continue; exit 1 }
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
# Install .NET
ExecSafe { & $PSScriptRoot\tools\Install-DotNet.ps1 -RootFolder $PSScriptRoot }
# Restore NuGet solution dependencies
Write-Host "Restoring all dependencies"
Get-ChildItem $PSScriptRoot\src\ -rec |? { $_.FullName.EndsWith('DevToys-Windows.sln') } |% {
$SolutionPath = $_.FullName;
Write-Host "Restoring packages for $($SolutionPath)..."
ExecSafe { & $env:DOTNET_EXE restore -p:RestoreNpm=true -p:PublishReadyToRun=true -v:quiet $SolutionPath }
}
Write-Host "Done."
Write-Output "---------------------------------------"
# Restore Monaco Editor
Write-Host "Restoring Monaco Editor"
ExecSafe { & $PSScriptRoot\tools\Restore-MonacoEditor.ps1 -RootFolder $PSScriptRoot }
Write-Host "Done."
Write-Output "---------------------------------------"