jsoverson / grunt-open

Open urls and files from a grunt task
MIT License
110 stars 19 forks source link

Ubuntu 13.04 #5

Closed FoxGit closed 11 years ago

FoxGit commented 11 years ago

Hi,

I am using grunt-open without any problem with Windows 7 but unfortunately it does not open my browser using Ubuntu 13.04. Any advice would be much appreciated. :)

jsoverson commented 11 years ago

Are you able to run xdg-open [filename] on the command line? if not, then you need to install xdg-open (presumably sudo apt-get install xdg-open)

FoxGit commented 11 years ago

Thx for your reply.

someUser@someWorkStation:~$ xdg-open
xdg-open - opens a file or URL in the user's preferred application

Synopsis

xdg-open { file | URL }

xdg-open { --help | --manual | --version }

Use 'man xdg-open' or 'xdg-open --manual' for additional info.

Seems to be installed. :(

someUser@someWorkStation:~/someFolder$ xdg-open index.html 
someUser@someWorkStation:~/someFolder$ Neues Fenster in aktueller Browsersitzung erstellt.

Opens up the page in the browser just fine.

FoxGit commented 11 years ago

I dug a little and found that line 27 in open.js is failing:

opener = path.join(__dirname, '../vendor/xdg-open');

This does not seem to to the correct path. Changed to

opener = 'xdg-open';

and it works fine. I cannot think of a downside as the paket in the path once installed but there is probably one to this solution (or you could use the full path '/usr/bin/X11/xdg-open' or '/usr/bin/xdg-open'). It seems to be a "bug" of open.js rather than this grunt plugin. So I tried to create an issue there. The open.js used seems to be this, now moved here. But I may be blind because I cannot find the issue page of the new project page. :(

jsoverson commented 11 years ago

The issues page seems to be here : https://github.com/pwnall/node-open/issues?page=1&state=open

That repo is a fork, I'm not sure why it is referenced via the package.json, opened an issue for it https://github.com/pwnall/node-open/issues/10

Closing in favor of a bug opened at node-open

FoxGit commented 11 years ago

I see. That looks strange indeed. Thx for pointing me in the right direction. I'll wait for a response as node-open. Have a nice day!

FoxGit commented 11 years ago

The author of open corrected the package.json link in version 0.0.4. Could you update the

"dependencies": {
    "open": "~0.0.2"
},

part of this project? Thanks.

jsoverson commented 11 years ago

Will do, but if you delete your grunt-open install and then reinstall, the updated version will be in place. That dependency definition is a range that will automatically pick up open@0.0.4