mirror of
https://github.com/coder/code-server.git
synced 2025-09-19 12:28:49 +08:00
Merge commit 'be3e8236086165e5e45a5a10783823874b3f3ebd' as 'lib/vscode'
This commit is contained in:
34
lib/vscode/scripts/node-electron.sh
Executable file
34
lib/vscode/scripts/node-electron.sh
Executable file
@ -0,0 +1,34 @@
|
||||
#!/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" \
|
||||
"$@"
|
||||
else
|
||||
ELECTRON_RUN_AS_NODE=1 \
|
||||
"$CODE" \
|
||||
"$@"
|
||||
fi
|
Reference in New Issue
Block a user