vscode-ftp-sync icon indicating copy to clipboard operation
vscode-ftp-sync copied to clipboard

uploadOnSave is not working

Open pgattu opened this issue 4 years ago • 5 comments
trafficstars

I am using VS Code 1.56.1 on Windows 10. I setup my ftp-sync.json as following. When I save files, they are not being uploaded. However, I can "Sync current file to remote", which works without any issue. Please help get uploadOnSave working. I already tried uninstalling and reinstalling ftp-sync, but it did not fix the problem.

{ "remotePath": "./htdocs", "host": "myhost", "username": "myuser", "password": "pswd", "port": 21, "secure": false, "protocol": "ftp", "uploadOnSave": true, "passive": false, "debug": false, "privateKeyPath": null, "passphrase": null, "agent": null, "allow": [], "ignore": [ "\.vscode", "\.git", "\.DS_Store" ], "generatedFiles": { "extensionsToInclude": [ "" ], "path": "" } }

pgattu avatar May 12 '21 04:05 pgattu

I have a similar bug, but in reverse mode... If I set uploadOnSave: false, still upload files to server...

MDylan avatar Jun 20 '21 21:06 MDylan

I had the same issue. tried to switch "uploadOnSave" to false and back to true. But after setting debug on true and reloading (restarting vscode). I could see that it worked. You can view the debug terminal in the tab "output" in terminal windows. then select the options "ftp-sync". I am using this config.

{
    "remotePath": "/html/workspace",
    "host": "***************",
    "username": "***************",
    "password": "***************",
    "port": 21,
    "secure": false,
    "protocol": "ftp",
    "uploadOnSave": true,
    "passive": false,
    "debug": true,
    "privateKeyPath": null,
    "passphrase": null,
    "agent": null,
    "allow": [
    ],
    "ignore": [
        "\\.vscode",
        "\\.git"
    ],
    "generatedFiles": {
        "extensionsToInclude": [
            ""
        ],
        "path": ""
    }
}

kdssoftware avatar Jun 22 '21 10:06 kdssoftware

Edit the following file to FIX:-

For Windows: C:\Users\(user)\.vscode\extensions\lukasz-wronski.ftp-sync-0.3.9\modules\on-generate.js For Linux: home/(user)/.vscode/extensions/lukasz-wronski.ftp-sync-0.3.9/modules/on-generate.js

File will look like this:

module.exports = function(document, getFtpSync, skipOnSaveCheck) {
if (document.uri.fsPath.indexOf(ftpconfig.rootPath().fsPath) < 0) return;
var config = ftpconfig.getConfig();

if (!config.uploadOnSave) return; // <------ ADD THIS LINE TO FIX

murad-faridi avatar Oct 13 '21 06:10 murad-faridi

Great this broke my live site... Thx

acoustika avatar Mar 03 '24 21:03 acoustika

After two and a half years still needed to use the workaround to not automatically sync files . I work directly with a local copy and production environment so auto-sync on save would be deadly. But the extension works great, thanks!

spareparts1dev avatar Apr 10 '24 06:04 spareparts1dev