Open server version of project path file


#1

Hi,

I am sure there must be a package to do this, I just don’t seem to be able to find the language to find it.

I help to maintain several large internal sites with deep and complex structures.

I use Remote-Ftp to upload changes to these on save, but I would also like to be able to right click on the tree, or open file in pane and select “Open in browser”, but what this would do is open a web browser with a predefined root prefix for the project i.e. and apend the project path, from a pre defined root folder within the project.

so say my project was at:
c:\projects\project1\

My open file was at:
c:\projects\project1\mysiterootfolder\folder2\folder3\file.json

if i currently do “Copy project Path” I get

\mysiterootfolder\folder2\folder3\file.json

If said package had per project settings:

Locally configured root folder was:
mysiterootfolder\

and my predefined root prefix for the project was
http://myserver:8000/

When I click “Open in browser” on the above file , it would open up my default (or selected) browser to:

http://myserver:8000/folder2/folder3/file.json

This is only simple string manipulation, so there must be something out there that does this.
Just to be clear, I don’t want to launch any local web servers, preview content within atom etc etc, it is just for opening a path on a live URL

Any ideas much appreciated.


#2

You can use process-palette to issue any shell command you like. For instance, chrome 'http://myserver:8000/{filePath}'. That should do the trick.


#3

Thank you DamnedScholar, that’s a top tip and seems to work quite well.

For anyone finding this, to achieve the same thing, the correct command to us would be:

start chrome http://yourwebserveraddress/{filePath}


#4

Caveat for posterity: that’s the correct Windows command. The precise words used will vary by operating system, but the principle works everywhere.