Skip to content

Instantly share code, notes, and snippets.

@swarupdonepudi
Created April 1, 2018 03:00
Show Gist options
  • Save swarupdonepudi/a81acf0641818cea6851d80769ba6dd6 to your computer and use it in GitHub Desktop.
Save swarupdonepudi/a81acf0641818cea6851d80769ba6dd6 to your computer and use it in GitHub Desktop.
Open DataGrip from Terminal
#!/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