fioan89 / sourcesync

A powerful plugin for performing one-way file synchronization for Intellij Idea and Pycharm projects
Other
89 stars 36 forks source link

SCP upload path uses wrong slash when uploading from windows to linux #80

Closed kev-vin closed 1 year ago

kev-vin commented 2 years ago

https://github.com/fioan89/sourcesync/blob/77de6c1acf7be2f45d8bced387928ddba764e713/src/main/kotlin/org/wavescale/sourcesync/synchronizer/SCPFileSynchronizer.kt#L96

This will run the SCP command with backslash paths when uploading from windows->linux, so uploads will not go to the correct location.

Potential fix could be to prompt the user for the type of slash expected on the remote host?

fioan89 commented 2 years ago

Indeed it's a known bug, affecting not only SCP but also FTP and FTPS. As a workaround can you configure a SSH (FTPS) connection? That does not have any issues with path conversion. I'll need to implement a more reliant mechanism in order to determine the remote path separator (which is not needed for SSH connections)

fioan89 commented 2 years ago

Potential fix could be to prompt the user for the type of slash expected on the remote host?

Could be, when the user creates the connection we could also ask the remote OS, but I think we can rely on the remote base path from the configuration to determine if it's a Unix or Windows path.