liximomo / vscode-sftp

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

VS code sftp how to only upload content inside a folder #852

Open craigcosmo opened 3 years ago

craigcosmo commented 3 years ago
{
    "name": "hostinger",
    "host": "111.111.111.111",
    "protocol": "ftp",
    "port": 21,
    "username": "1234",
    "password": "1234",
    "remotePath": "/",
    "rootPath": "build/**",
    "watcher": {
        "files": "build/*.{js,css,json,ico,png,html,ttf,eot,woff,woff2,svg}",
        "autoUpload": true,
        "autoDelete": false
    }
}

I want to upload the files inside the folder build to the server. However the above config wont do that. the above config will upload the folder build to server.

antedoro commented 3 years ago

Hi I have the same problem. Please can someone answare to this question?

oreaird commented 3 years ago

Would love to know how to this,

{ "name": "Dev BYOD", "host": "111.111.111.111", "protocol": "sftp", "port": 22, "username": "1234", "password": "1234", "remotePath": "/var/www/html/", "watcher": { "files": "dist/*.{html,js,css}", "autoUpload": false, "autoDelete": false } }

It adds the Dist folder, to the server I only want the files within.

raoul2000 commented 3 years ago

In case it helps, it is working fine for me, as long as you set the context property to ./build. Here is my config :

{
    "name": "My Server",
    "host": "10.19.5.33",
    "protocol": "sftp",
    "port": 22,
    "username": "user1",
    "remotePath": "/folder1/folder2/folder3",
    "context": "./build",
    "uploadOnSave": false,
    "watcher": {
        "files": "*.{js,html}",
        "autoUpload": true,
        "autoDelete": false
    }
}

All js and html files in ./build will be copied to /folder1/folder2/folder3

ghost commented 3 years ago

I'll add this to the documentation.