-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path05_build_vsix.ps1
44 lines (34 loc) · 1.13 KB
/
05_build_vsix.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
38
39
40
41
42
43
44
Function Checkpoint-Extension {
Copy-Item -Path ".\build\ghdl-language-server\vscode-client\extension.ts" -Destination "extension.backup.ts"
}
Function Edit-Extension {
git apply .\extension.ts.patch
}
Function Restore-Extension {
Move-Item -Path "extension.backup.ts" -Force -Destination ".\build\ghdl-language-server\vscode-client\extension.ts"
}
Function Add-Binaries {
Remove-Item -Path "build\ghdl-language-server\vscode-client\bin" -Recurse -Force -ErrorAction Ignore;
Copy-Item -Path "build\pyinstaller\dist\ghdl-ls" -Recurse -Destination "build\ghdl-language-server\vscode-client\bin"
}
Function Install-Modules {
Write-Host "Installing Node modules"
$LogLevelParam = if ($env:CI) { "--loglevel=error" } else { "" }
npm install $LogLevelParam
npm install vsce $LogLevelParam
}
Function Invoke-Vsce {
Write-Host "Invoking vsce"
& "node_modules\.bin\vsce" package -o "..\.."
}
Function Main() {
Checkpoint-Extension
Edit-Extension
Add-Binaries
Push-Location "build\ghdl-language-server\vscode-client"
Install-Modules
Invoke-Vsce
Pop-Location
Restore-Extension
}
Main