mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
fix: remove python usage in macos cli wrapper (#138582)
Fixes https://github.com/microsoft/vscode/issues/134635 Fixes https://github.com/microsoft/vscode/issues/137954
This commit is contained in:
parent
54eb53ba92
commit
fc8a61280b
|
@ -3,8 +3,23 @@
|
|||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
function realpath() { python -c "import os,sys; print(os.path.realpath(sys.argv[1]))" "$0"; }
|
||||
CONTENTS="$(dirname "$(dirname "$(dirname "$(dirname "$(realpath "$0")")")")")"
|
||||
function app_realpath() {
|
||||
SOURCE=$1
|
||||
while [ -h "$SOURCE" ]; do
|
||||
DIR=$(dirname "$SOURCE")
|
||||
SOURCE=$(readlink "$SOURCE")
|
||||
[[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE
|
||||
done
|
||||
SOURCE_DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
|
||||
echo "${SOURCE_DIR%%${SOURCE_DIR#*.app}}"
|
||||
}
|
||||
|
||||
APP_PATH="$(app_realpath "${BASH_SOURCE[0]}")"
|
||||
if [ -z "$APP_PATH" ]; then
|
||||
echo "Unable to determine app path from symlink : ${BASH_SOURCE[0]}"
|
||||
exit 1
|
||||
fi
|
||||
CONTENTS="$APP_PATH/Contents"
|
||||
ELECTRON="$CONTENTS/MacOS/Electron"
|
||||
CLI="$CONTENTS/Resources/app/out/cli.js"
|
||||
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" --ms-enable-electron-run-as-node "$@"
|
||||
|
|
Loading…
Reference in a new issue