liximomo / vscode-sftp

Super fast sftp/ftp extension for VS Code
MIT License
1.5k stars 256 forks source link

Absolute path used for "context" used when prefixing a forward slash #903

Open DanielVernall opened 3 years ago

DanielVernall commented 3 years ago

I've just started using the extension, and I set up my sftp.json file in the .vscode folder to this (some parts redacted):

{
    "name": "name",
    "host": "host",
    "protocol": "sftp",
    "port": 18765,
    "agent": "pageant",
    "username": "username",
    "remotePath": "/path/to/folder/staging",
    "context": "/build",
    "uploadOnSave": true,
    "profiles": {}
}

The SFTP Remote explorer works fine, but I was getting a Config Not Found error when trying to upload. I tried to Edit a remote file in Local, and when I revealed in file explorer I found a new folder had been created in the Root of my C: drive called /build and the folder was placed there.

When I removed the forwards slash before "/build", the correct relative path was used, and it fixed my Config Not Found error. If a preceding forward slash is found, the extension should either remove it automatically, or produce an error.