Created
August 17, 2020 14:16
-
-
Save aguinaldotupy/dc0bc98910283bb60d09fced008f6ca3 to your computer and use it in GitHub Desktop.
Open file (flare ignition - laravel) with phpstorm
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
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://developer.happyr.com/open-files-in-phpstorm-from-you-symfony-application