sanduhrs / phpstorm-url-handler

GNU General Public License v3.0
217 stars 35 forks source link

Command is pstorm or phpstorm ? #4

Closed leogout closed 7 years ago

leogout commented 7 years ago

Hi, I installed a brand new PhpStorm 2017.1 and after running the installation script, I saw that the command to launch the IDE was pstorm instead of phpstorm.

I had to change it in the phpstorm-url-handler script in order to make it work.

Do you want me to add a test for this use case ? Something like :

if type phpstorm > /dev/null; then
    /usr/bin/env phpstorm --line "${line}" "${file}"
else
    /usr/bin/env pstorm --line "${line}" "${file}"
fi
sanduhrs commented 7 years ago

Hi leogout, on what distribution are you? Thanks for contributing!

leogout commented 7 years ago

Hi, your welcome !

I'm on ubuntu 16.04, it's a fresh install on VMware. I installed phpStorm from the archive available here and I ran the installation script (I think it was /opt/phpStorm/bin/phpstorm.sh).

In the PR I added an notify-send because I thougnt it was useful, but I dont know if it is really cross platform. Feel free to remove it.

Cheers.

oestoer commented 7 years ago

Hi, I had the same issue, the fix by @leogout solved it for me. Thanks

sanduhrs commented 7 years ago

What I don't understand is, where the pstorm executable is coming from. Looking into the archive, there is no pstorm.sh in /bin. And the installation instructions do not mention a pstorm.sh either, in fact no mention of pstrom across all the distributed files.

Could it be you symlinked bin/phpstorm.sh to /bin/pstorm manually?

Can you please issue: whereis pstorm and whereis phpstorm and post the results in here?

oestoer commented 7 years ago
whereis pstorm
pstorm: /usr/local/bin/pstorm
whereis phpstorm
phpstorm:

Where pstorm executable is coming from? In the menu Tools > Create Command-line Launcher... and pstorm is the deafult suggestion (at least for me in 2017.1 on Ubuntu)

leogout commented 7 years ago

Same as @oestoer :

whereis pstorm
pstorm: /usr/local/bin/pstorm

whereis phpstorm
phpstorm: /opt/phpStorm/bin/phpstorm.sh /opt/phpStorm/bin/phpstorm.vmoptions /opt/phpStorm/bin/phpstorm.png /opt/phpStorm/bin/phpstorm64.vmoptions

I also tried on another computer at work with Ubuntu 16.04 and it produced the same kind of output.

sanduhrs commented 7 years ago

So what I found is, that PhpStorm creates a executable /usr/local/bin/pstorm, when instructed via the Tools menu. That file knows where the PhpStorm installation is located at and executes bin/phpstorm.sh from there.

Thanks for reporting, your patch has been merged.