summaryrefslogtreecommitdiff
path: root/idea
blob: 2d2fc35e435a84694c3cc5c2b5e213b1b168baf2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env bash

set -euo pipefail

main() {
  local TOOLBOX_PATH="$HOME/.local/share/JetBrains/Toolbox"

  for edition in intellij-idea-{ultimate,community-edition}; do
    local idea_bin="$TOOLBOX_PATH/apps/$edition/bin/idea.sh"
    if [ -x "$idea_bin" ]; then
      "$idea_bin" "$@" >/dev/null 2>&1 &
      exit 0
    fi
  done

  echo "No idea found in toolbox path: $TOOLBOX_PATH" >&2
  exit 1
}

main "$@"