summaryrefslogtreecommitdiff
path: root/bin/build-electron
blob: 51bb7de4399f2a0de750d88988d6bb757bb175f1 (plain)
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
#!/bin/bash
ARCH=$(python -c "import platform; n = platform.architecture()[0]; print(n)")

set -e
set -x

if [ "$BUILD" = "windows" ]; then
  if [ "$ARCH" = "32bit" ]; then
	  args="-w --ia32"
	else
	  args="-w --x64"
	fi
elif [ "$BUILD" = "linux" ]; then
  args="-l"
elif [ "$BUILD" = "osx" ]; then
  cp installer_scripts/electron-entitlements.plist electron/build/
  args="-m"
fi

# electron version setting on release
if [[ "$VERSION" =~ ^v[0-9][.0-9]+$ ]]; then
    sed -i'' -e 's/11.99.11/'"${VERSION#v}"'/' electron/package.json
fi
cd electron
which yarn > /dev/null 2>&1 || npm install -g yarn
yarn --link-duplicates --pure-lockfile
yarn run dist ${args}