-
Notifications
You must be signed in to change notification settings - Fork 11
/
build.ps1
52 lines (42 loc) · 977 Bytes
/
build.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
45
46
47
48
49
50
51
52
param(
# Determines if we run `npm pack`.
[Parameter()]
[switch]
$Pack,
# Determines if we run the tests.
[Parameter()]
[switch]
$Test,
# Runs the watch npm command instead.
[Parameter()]
[switch]
$Watch,
# Determines if we hack the compiled content into the installed plugin
[Parameter()]
[switch]
$Update
)
if (!(Get-Command npm)) {
throw "You must install Node.js & npm."
}
npm install
if (Test-Path .\out) {
Remove-Item -Recurse -Force .\out
}
if ($Watch.IsPresent) {
npm run watch
return
} else {
npm run compile
}
if ($Test.IsPresent) {
# We would run the tests here.
}
if ($Pack.IsPresent) {
npm pack
}
if ($Update.IsPresent) {
Write-Host "Updating installed extension..."
Copy-Item out\client\* $env:LocalAppData\coc\extensions\node_modules\coc-omnisharp\out\client\
Copy-Item .\package.json $env:LocalAppData\coc\extensions\node_modules\coc-omnisharp\
}