Skip to content

Instantly share code, notes, and snippets.

@lambdageek
Created May 4, 2019 00:11
Show Gist options
  • Save lambdageek/0e4fb2d7498f91544b8f7150715d02b0 to your computer and use it in GitHub Desktop.
Save lambdageek/0e4fb2d7498f91544b8f7150715d02b0 to your computer and use it in GitHub Desktop.
Visual Studio Code script for Cygwin
#! /usr/bin/env bash
if [ "z$1" == "z--help" ]; then
echo "vscode [FILE]"
echo " Starts Visual Studio Code for Windows"
echo " If FILE is given (as a unix path) it will be opened."
exit;
fi
winpath="C:\\Program Files\\Microsoft VS Code\\Code.exe"
progpath=`cygpath -u "$winpath"`
filepath=
if [ "z$1" != z ]; then
filepath=`cygpath -w "$1"`
fi
cygstart "$progpath" "$filepath"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment