Skip to content

Instantly share code, notes, and snippets.

@limafelipe
Created January 16, 2017 02:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save limafelipe/c8bcd7c251759a504d21fa0c401a1591 to your computer and use it in GitHub Desktop.
Save limafelipe/c8bcd7c251759a504d21fa0c401a1591 to your computer and use it in GitHub Desktop.
open visual studio from command line
function code {
if [[ $# = 0 ]]
then
open -a "Visual Studio Code"
else
local argPath="$1"
[[ $1 = /* ]] && argPath="$1" || argPath="$PWD/${1#./}"
open -a "Visual Studio Code" "$argPath"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment