Visual Studio Code Mac

From Federal Burro of Information
Revision as of 17:20, 8 March 2021 by David (talk | contribs) (Created page with " My edit: /usr/local/bin/code <pre> #!/usr/bin/env bash -x # # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

My edit:

/usr/local/bin/code

#!/usr/bin/env bash -x
#
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.

# /Applications/Visual Studio Code.app/Contents/MacOS/Electron
# /Applications/Visual Studio Code.app/Contents/Resources/app/out/cli.js

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"
ELECTRON="/Applications/Visual Studio Code.app/Contents/MacOS/Electron"
# CLI="$CONTENTS/Resources/app/out/cli.js"
CLI="/Applications/Visual Studio Code.app/Contents/Resources/app/out/cli.js"
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"
exit $?