Created
June 8, 2016 14:40
-
-
Save williameliel/d00958f4ed7a0b6e806fb03026adad12 to your computer and use it in GitHub Desktop.
Add Visual Studio Code to Command line with a Folder as params...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#in ~/bin create a file called vscode and give it execute permissions and copy the following: | |
#!/bin/bash | |
if [[ $# = 0 ]] | |
then | |
open -a "Visual Studio Code" | |
else | |
[[ $1 = /* ]] && F="$1" || F="$PWD/${1#./}" | |
open -a "Visual Studio Code" --args "$F" | |
fi | |
#That's it! if you havent done it, also add this to ~/.bash_profile | |
#export PATH=~/bin:$PATH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment