lukasz-wronski / vscode-ftp-sync

Ftp Sync plugin for Visual Studio Code
https://marketplace.visualstudio.com/items/lukasz-wronski.ftp-sync
320 stars 89 forks source link

uploadOnSave is not working #339

Open pgattu opened 3 years ago

pgattu commented 3 years ago

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": "" } }

MDylan commented 3 years ago

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

kdssoftware commented 3 years ago

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": ""
    }
}
murad-faridi commented 2 years ago

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

acoustika commented 4 months ago

Great this broke my live site... Thx

spareparts1dev commented 3 months ago

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!