-
Notifications
You must be signed in to change notification settings - Fork 221
Expand file tree
/
Copy pathsetup.ps1
More file actions
66 lines (58 loc) · 1.75 KB
/
setup.ps1
File metadata and controls
66 lines (58 loc) · 1.75 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
Set-StrictMode -Version 2
$ErrorActionPreference = 'Stop'
Write-Host "Fetching submodules" -ForegroundColor White
git submodule update --recursive --init
if ($LastExitCode -ne 0) {
throw "git failed with exit code $LastExitCode"
}
Write-Host "Creating stub .env" -ForegroundColor White
if (!(Test-Path './source/WebApp.Server/.env')) {
Copy-Item './source/WebApp.Server/.env.template' './source/WebApp.Server/.env'
}
Write-Host "Installing local tools" -ForegroundColor White
dotnet tool restore
if ($LastExitCode -ne 0) {
throw "dotnet failed with exit code $LastExitCode"
}
Write-Host "Installing node modules: roslyn-branches" -ForegroundColor White
Push-Location "$PSScriptRoot/roslyn-branches"
try {
npm ci
if ($LastExitCode -ne 0) {
throw "npm ci failed with exit code $LastExitCode"
}
}
finally {
Pop-Location
}
Write-Host "Preparing externals: mirrorsharp" -ForegroundColor White
Push-Location './source/#external/mirrorsharp/WebAssets'
try {
npm ci
if ($LastExitCode -ne 0) {
throw "npm ci failed with exit code $LastExitCode"
}
npm run build
if ($LastExitCode -ne 0) {
throw "npm ci failed with exit code $LastExitCode"
}
}
finally {
Pop-Location
}
Write-Host "Installing node modules" -ForegroundColor White
Push-Location './source/WebApp'
try {
npm ci
if ($LastExitCode -ne 0) {
throw "npm ci failed with exit code $LastExitCode"
}
}
finally {
Pop-Location
}
Write-Host ""
Write-Host "SharpLab setup done." -ForegroundColor White
Write-Host "Run " -ForegroundColor White -NoNewLine
Write-Host "sl run" -ForegroundColor Cyan -NoNewLine
Write-Host " to start." -ForegroundColor White -NoNewLine