Skip to content

Instantly share code, notes, and snippets.

@zimmem
Last active April 19, 2017 12:26
Show Gist options
  • Save zimmem/022a1aabe1853927c07e8c3a713faa5b to your computer and use it in GitHub Desktop.
Save zimmem/022a1aabe1853927c07e8c3a713faa5b to your computer and use it in GitHub Desktop.
vs code for cygwin
#!/usr/bin/env bash
#
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
case "`uname`" in
CYGWIN*) cygwin=true;;
esac
NAME="Code"
if $cygwin; then
VSCODE_PATH="$(dirname "$(dirname "$(realpath "$(cygpath -d "$0")")")")"
FILE=$(cygpath -d "$@")
else
VSCODE_PATH="$(dirname "$(dirname "$(realpath "$0")")")"
FILE=$@
fi
ELECTRON="$VSCODE_PATH/$NAME.exe"
CLI="$VSCODE_PATH/resources/app/out/cli.js"
ELECTRON_NO_ATTACH_CONSOLE=1 ATOM_SHELL_INTERNAL_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$FILE"
exit $?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment