Welcome to mirror list, hosted at ThFree Co, Russian Federation.

node-electron.sh « scripts - github.com/microsoft/vscode.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2bf50817c94f9d6680b43c1f39c6751f34782f4f (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
28
29
30
31
32
33
34
35
36
#!/usr/bin/env bash

if [[ "$OSTYPE" == "darwin"* ]]; then
	realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"; }
	ROOT=$(dirname $(dirname $(realpath "$0")))
else
	ROOT=$(dirname $(dirname $(readlink -f $0)))
fi

pushd $ROOT

if [[ "$OSTYPE" == "darwin"* ]]; then
	NAME=`node -p "require('./product.json').nameLong"`
	CODE="$ROOT/.build/electron/$NAME.app/Contents/MacOS/Electron"
else
	NAME=`node -p "require('./product.json').applicationName"`
	CODE="$ROOT/.build/electron/$NAME"
fi

# Get electron
yarn electron

popd

export VSCODE_DEV=1
if [[ "$OSTYPE" == "darwin"* ]]; then
	ulimit -n 4096 ; ELECTRON_RUN_AS_NODE=1 \
		"$CODE" \
		"$@" \
		--ms-enable-electron-run-as-node
else
	ELECTRON_RUN_AS_NODE=1 \
		"$CODE" \
		"$@" \
		--ms-enable-electron-run-as-node
fi