Created
April 1, 2018 03:00
-
-
Save swarupdonepudi/a81acf0641818cea6851d80769ba6dd6 to your computer and use it in GitHub Desktop.
Open DataGrip from Terminal
This file contains 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
#!/bin/sh | |
# check for where the latest version of DataGrip is installed | |
DATAGRIP=`ls -1d /Applications/DataGrip* | tail -n1` | |
wd=`pwd` | |
# were we given a directory? | |
if [ -d "$1" ]; then | |
# echo "checking for things in the working dir given" | |
wd=`ls -1d "$1" | head -n1` | |
fi | |
# were we given a file? | |
if [ -f "$1" ]; then | |
# echo "opening '$1'" | |
open -a "$DATAGRIP" "$1" | |
else | |
open -a "$DATAGRIP" . | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment