Skip to content

Instantly share code, notes, and snippets.

@aguinaldotupy
Created August 17, 2020 14:16
Show Gist options
  • Save aguinaldotupy/dc0bc98910283bb60d09fced008f6ca3 to your computer and use it in GitHub Desktop.
Save aguinaldotupy/dc0bc98910283bb60d09fced008f6ca3 to your computer and use it in GitHub Desktop.
Open file (flare ignition - laravel) with phpstorm
arg=${1}
pattern=".*file(:\/\/|\=)(.*)&line=(.*)"
# Get the file path.
lineFile=$(echo "${arg}" | sed -r "s/${pattern}/\2/")
file=$(echo "${lineFile}" | sed 's/\%2F/\//g')
# Get the line number.
line=$(echo "${arg}" | sed -r "s/${pattern}/\3/")
echo "${file}"
# Check if phpstorm|pstorm command exist.
if type ~/.local/share/JetBrains/Toolbox/apps/PhpStorm/ch-0/*/bin/phpstorm.sh > /dev/null; then
~/.local/share/JetBrains/Toolbox/apps/PhpStorm/ch-0/*/bin/phpstorm.sh --line "${line}" "${file}"
elif type phpstorm > /dev/null; then
/usr/bin/env phpstorm --line "${line}" "${file}"
elif type pstorm > /dev/null; then
/usr/bin/env pstorm --line "${line}" "${file}"
fi
@aguinaldotupy
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment