Skip to content

Commit

Permalink
Updates code cli to remove python requirement.
Browse files Browse the repository at this point in the history
Uses less subshells and more bash-native syntax.

Fixes microsoft#141880
  • Loading branch information
n8felton committed Jan 31, 2022
1 parent 49a109a commit ecf4182
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions resources/darwin/bin/code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# 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")")")")")"
ELECTRON="$CONTENTS/MacOS/Electron"
CLI="$CONTENTS/Resources/app/out/cli.js"
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" --ms-enable-electron-run-as-node "$@"
exit $?
CODE_PATH=$(readlink "${0}")
APP_BUNDLE=${CODE_PATH%%${CODE_PATH#*.app}}
ELECTRON="${APP_BUNDLE}/Contents/MacOS/Electron"
CLI="${APP_BUNDLE}/Contents/Resources/app/out/cli.js"
ELECTRON_RUN_AS_NODE=1 "${ELECTRON}" "${CLI}" --ms-enable-electron-run-as-node "${@}"
exit ${?}

0 comments on commit ecf4182

Please sign in to comment.