Skip to content

Instantly share code, notes, and snippets.

@sonicradish
Created May 16, 2019 21:16
Show Gist options
  • Save sonicradish/9fe54be81e00cbe84ad53dfc115bfd44 to your computer and use it in GitHub Desktop.
Save sonicradish/9fe54be81e00cbe84ad53dfc115bfd44 to your computer and use it in GitHub Desktop.
VS Code CLI
#!/usr/bin/env bash
# Deeply inspired by https://github.com/Microsoft/vscode/blob/1.17.0/resources/darwin/bin/code.sh
function realpath() { /usr/bin/python -c "import os,sys; print(os.path.realpath(sys.argv[1]))" "$0"; }
CONTENTS="$(dirname "$(dirname "$(dirname "$(realpath "$0")")")")"
ELECTRON="$CONTENTS/MacOS/Hyper"
CLI="$CONTENTS/Resources/bin/cli.js"
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"
exit $?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment