-
-
Save zaypen/e50f0af74365f0818e7723874ec81b8c to your computer and use it in GitHub Desktop.
Terminal shortcut with arguments supported for IntelliJ IDEA on macOS
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
#!/usr/bin/env bash | |
# Terminal shortcut with arguments supported for IntelliJ IDEA on macOS, | |
# put this file into `/usr/bin` or `/usr/local/bin` or anywhere in PATH, | |
# and use `chmod` to make it executable, | |
# then you could use `idea` in terminal to run IDEA. | |
IDEA_APP="IntelliJ IDEA.app" | |
if [ -x "/Applications/$IDEA_APP" ]; then | |
IDEA_PATH="/Applications" | |
elif [ -x "$HOME/Applications/$IDEA_APP" ]; then | |
IDEA_PATH="$HOME/Applications" | |
else | |
echo "Cannot locate $IDEA_APP, it is usually located in /Applications." | |
exit 1 | |
fi | |
open -a "$IDEA_PATH/$IDEA_APP" "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment