vscode/scripts/node-electron.sh
Robo d0e516655a
fix: rename product executable on macOS (#291948)
* fix: rename product executable name on macOS

* chore: update test/automation/src/electron.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* chore: update test/automation/src/electron.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* chore: rename in additional places

* chore: rename in code-perf.js

* chore: create symlink for backwards compatibility

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-03 14:50:21 -08:00

36 lines
770 B
Bash
Executable File

#!/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"`
EXE_NAME=`node -p "require('./product.json').nameShort"`
CODE="$ROOT/.build/electron/$NAME.app/Contents/MacOS/$EXE_NAME"
else
NAME=`node -p "require('./product.json').applicationName"`
CODE="$ROOT/.build/electron/$NAME"
fi
# Get electron
npm run 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