Skip to content

Instantly share code, notes, and snippets.

@takuya
Last active January 30, 2019 14:03
Show Gist options
  • Save takuya/7f379a034f0b5a0d8c0c0d0794a2830c to your computer and use it in GitHub Desktop.
Save takuya/7f379a034f0b5a0d8c0c0d0794a2830c to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash # -x -v
name=`basename $0`
APP_PATH=`realpath ~/Applications/JetBrains\ Toolbox`
declare -A APPNAME
APPNAME[phpstorm]="$APP_PATH/PhpStorm.app"
APPNAME[idea]="$APP_PATH/IntelliJ IDEA Ultimate.app"
APPNAME[pycharm]="$APP_PATH/PyCharm Professional.app"
APPNAME[webstorm]="$APP_PATH/WebStorm.app"
APPNAME[rubymime]="$APP_PATH/RubyMine.app"
APP=${APPNAME[$name]}
ARGS=()
for arg; do
if [[ -e $PWD/$arg ]] ; then
ARGS+=($PWD/$arg)
fi
done
echo open -a "$APP" --args ${ARGS[*]}
open -a "$APP" --args ${ARGS[*]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment