-
-
Save rijnhard/757d02948b00e697ca570535a8ad7617 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/bash | |
if [ $# -lt 3 ]; then | |
echo "$0 <app> <channel> <binpath> [*args]" | |
exit 1 | |
fi | |
app=$1 | |
channel=$2 | |
binpath=$3 | |
shift | |
shift | |
shift | |
base=~/.local/share/JetBrains/Toolbox/apps/$app | |
apppath=$base/$channel | |
ver=$(/bin/ls "$apppath" | tail -n 1) | |
if [ -z "$ver" ]; then | |
echo "Can not find $app - $channel" | |
exit 1 | |
fi | |
$apppath/$ver/bin/${binpath}.sh "$@" |
This file contains hidden or 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 | |
# PhpStorm URL Handler | |
# phpstorm://open?url=file://@file&line=@line | |
# phpstorm://open?file=@file&line=@line | |
# | |
# @license GPL | |
# @author Stefan Auditor <[email protected]> | |
# @modified by Rijnhard Hessel <[email protected]> | |
TOOLBOX_HOME=~/.local/share/JetBrains/Toolbox/apps/ | |
# | |
# param app Directory name () | |
# | |
function find_idea() { | |
local app=$1 | |
local binpath=$(echo "${app}" | tr '[:upper:]' '[:lower:]') | |
local apppath=$(find "${TOOLBOX_HOME}/${app}/" \ | |
! -path '*.vmoptions' ! -path '*.plugins' \ | |
-maxdepth 2 -mindepth 2 -type d \ | |
-exec echo {} \; \ | |
| sort -t '\0' -n \ | |
| tail -n -1) | |
if [ -z "$apppath" ]; then | |
echo "Can not find $app in ${TOOLBOX_HOME}/${app}/" | |
exit 2 | |
fi | |
echo "$apppath/bin/${binpath}.sh" | |
} | |
arg=${1} | |
pattern=".*file(:\/\/|\=)(.*)&line=(.*)" | |
file=$(echo "${arg}" | sed -r "s/${pattern}/\2/") | |
line=$(echo "${arg}" | sed -r "s/${pattern}/\3/") | |
executable=$(find_idea PhpStorm) | |
"${executable}" --line "${line}" "${file}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment