Visual Studio Code Mac

From Federal Burro of Information
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 $?