vscode-sftp: During uploadOnSave, files in "ignored" directories are still uploaded

Issue:

During uploadOnSave, files in “ignored” directories are still uploaded on save. In other words, the ‘ignore’ setting is not respected for directories during uploadOnSave.

Relevant Settings:

{
    ...
    "uploadOnSave": true,
    "ignore": [
        "**/ignoreme"
    ]
}

Steps to duplicate:

  • Create new directory ignoreme/
  • Create a new file ignoreme/myfile.txt
  • Set uploadOnSave to true
  • Add **/ignoreme to the ignore list.
  • Change ignoreme/myfile.txt and save.
  • Note that ignoreme/myfile.txt is uploaded to the server, even though ignoreme/ is an ignored folder.

What should happen:

  • Files in “ignored” directories should not upload, even during uploadOnSave.

Please fix this. It is very annoying. It causes my local .git/ files to upload to the server.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

Change to this and provide me the log if it still can’t work.

"ignore": [
        ".vscode",
        ".DS_Store",
        "project_details.txt",
        ".eslintrc.json",
        "node_modules",
        ".git"
]

Hey liximomo. I’m having the exact same issue, I can’t get the package to ignore anything other than the .vscode folder where the config is in. I think it was working properly some time ago. I’ve been testing some variations of the config, none works. I’ve tried multiple patterns for the ignore array but nothing seems to work.

Anyway here’s my output:

[info]: config at /Users/** {
    "protocol": "sftp",
    "host": "foo.bar",
    "port": 22,
    "username": "username",
    "password": "***********",
    "agent": null,
    "privateKeyPath": null,
    "passphrase": null,
    "interactiveAuth": false,
    "secure": false,
    "secureOptions": null,
    "passive": false,
    "remotePath": "/foo.bar",
    "uploadOnSave": true,
    "syncMode": "update",
    "ignore": [
        "**/.vscode/**",
        "**/.DS_Store/**",
        "project_details.txt",
        ".eslintrc.json",
        "**/node_modules/**",
        "**/.git/**"
    ],
    "watcher": {
        "files": false,
        "autoUpload": false,
        "autoDelete": false
    },
    "concurrency": 512,
    "context": "/Users/**"
}

Thanks in advance.

I am trying to ignore node_modules and tried **/node_modules/**, /node_modules, /node_modules/**, none of them works, need help!