RemoteTree icon indicating copy to clipboard operation
RemoteTree copied to clipboard

No upload on save

Open st3ph opened this issue 7 years ago • 5 comments

First things first, thank you for this plugin, I have been waiting for something like this since a long time Unfortunately I can set a remote server, browser and open files but when I save them they aren't upload to the server.

Sublime version: 3.1.1 Build 3176

Let me know if you need more informations

st3ph avatar May 15 '18 13:05 st3ph

Yeah, I see same situation: when I save file it isn't uploaded back to server. Nothing is logged in console. PS: I'm using Windows10 / ST3 3.1.1, b.3176

dmarienko avatar Sep 28 '18 15:09 dmarienko

The same here.

But I think that the secret is this: This Sublime Text 3 plugin allows you to browse directories on remote servers without need to download the whole file structure.

BROWSE is the magical word.

atarx avatar Dec 02 '18 07:12 atarx

BROWSE is the magical word.

Sure, but the website also says:

Each local file under "local_path" on save will be uploaded back to the server.

It's not just for browsing. It should save the file.

So I did a little debugging by adding some print's to the on_post_save_async function in remote-tree.py. And it turns out that the prefix you configure in the RemoteTree settings is wrong. By default, this is set to: "local_path": "~/Sites/" This probably works on Linux, but not on Windows. The local path is expanded to your user directory, for example in my case it becomes: C:\Users\gwijnja/Sites/ Note the mixed backslashes (Unix-style) and forward slashes (Windows-style) in the same path. And then the function checks whether the filename of the file you are saving (for example C:\Users\gwijnja\Sites\\pj.txt) starts with C:\Users\gwijnja/Sites/. It doesn't, so it will not even attempt to save the file remotely. (If the filename does not start with the local path prefix, then it assumes the file does not originate from the remote server.)

A solution is to change your RemoteTree configuration's "local_path": "~/Sites/" to "local_path": "~\\Sites\\" (yes, with double slashes) and also apply the fix from this other thread: https://github.com/deNULL/RemoteTree/issues/14

You may need to restart Sublime, I'm not sure. But then it will work.

gwijnja avatar Feb 02 '19 00:02 gwijnja

Thanks, @gwijnja, that works

xtrinch avatar Aug 16 '19 10:08 xtrinch

BROWSE is the magical word.

Sure, but the website also says:

Each local file under "local_path" on save will be uploaded back to the server.

It's not just for browsing. It should save the file.

So I did a little debugging by adding some print's to the on_post_save_async function in remote-tree.py. And it turns out that the prefix you configure in the RemoteTree settings is wrong. By default, this is set to: "local_path": "~/Sites/" This probably works on Linux, but not on Windows. The local path is expanded to your user directory, for example in my case it becomes: C:\Users\gwijnja/Sites/ Note the mixed backslashes (Unix-style) and forward slashes (Windows-style) in the same path. And then the function checks whether the filename of the file you are saving (for example C:\Users\gwijnja\Sites\\pj.txt) starts with C:\Users\gwijnja/Sites/. It doesn't, so it will not even attempt to save the file remotely. (If the filename does not start with the local path prefix, then it assumes the file does not originate from the remote server.)

A solution is to change your RemoteTree configuration's "local_path": "~/Sites/" to "local_path": "~\\Sites\\" (yes, with double slashes) and also apply the fix from this other thread: #14

You may need to restart Sublime, I'm not sure. But then it will work.

or "local_path": "C:/Sites/", and in remote-tree.py:

def on_post_save_async(self, view):
		global servers
		fname = view.file_name().replace('\\', '/')
		if not fname:
			return

mercurykd avatar Oct 27 '19 12:10 mercurykd