Skip to content

Instantly share code, notes, and snippets.

@tzvetkoff
Last active April 11, 2018 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tzvetkoff/f67d1f23def1fa0fa7dfc50140f3bff0 to your computer and use it in GitHub Desktop.
Save tzvetkoff/f67d1f23def1fa0fa7dfc50140f3bff0 to your computer and use it in GitHub Desktop.
JetBrains Toolbox CLI Scripts

JetBrains Toolbox CLI Scripts

JetBrains Toolbox fails to update it's CLI scripts from time to time, and even if it does - they don't work as expected.

This is my ugly attempt to fix this on OSX.

#!/bin/bash
jbtb-open CLion ch-0 "${@}"
#!/bin/bash
jbtb-open datagrip ch-0 "${@}"
#!/bin/bash
jbtb-open Goland ch-0 "${@}"
#!/bin/bash
if [[ -z "${2}" ]]; then
echo "usage: ${0} <app> <channel> [args]" >&2
exit 1
fi
app="${1}"; shift
channel="${1}"; shift
dir="${HOME}/Library/Application Support/JetBrains/Toolbox/apps/${app}/${channel}"
ver=$(find "${dir}" -type d -maxdepth 1 | tail -1)
if [[ -z "${ver}" ]]; then
echo "${0}: no versions of ${app} in ${channel} installed" >&2
exit 1
fi
open -a "${ver}/${app}.app" "${@}"
#!/bin/bash
jbtb-open RubyMine ch-0 "${@}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment