-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.ps1
33 lines (23 loc) · 981 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
Param (
[Parameter(Mandatory = $True)][string]$version,
[Switch] $OnlyWindows,
[Switch] $Only64Bit
)
$ErrorActionPreference = "Continue"
$root = [System.IO.Path]::GetFullPath($PSScriptRoot)
$bashPath = (($root -replace "\\","/") -replace ":","").ToLower().Trim("/")
Remove-Item $root\lib -Force -Recurse -ErrorAction SilentlyContinue
# npm install -g node-gyp
npm ci --ignore-scripts
if (-not $Only64Bit) {
node-gyp rebuild --target=$version --arch=ia32 --dist-url=https://atom.io/download/electron
}
node-gyp rebuild --target=$version --arch=x64 --dist-url=https://atom.io/download/electron
if (-not $OnlyWindows)
{
if (-not $Only64Bit)
{
bash -c "cd /mnt/$bashPath && HOME=~/.electron-gyp node-gyp rebuild --target=$version --arch=ia32 --dist-url=https://atom.io/download/electron"
}
bash -c "cd /mnt/$bashPath && HOME=~/.electron-gyp node-gyp rebuild --target=$version --arch=x64 --dist-url=https://atom.io/download/electron"
}