SchoofsKelvin / vscode-sshfs

Extension for Visual Studio Code: File system provider using SSH
GNU General Public License v3.0
543 stars 36 forks source link

ssh-shell Task on multiple hosts #322

Closed Naramsim closed 2 years ago

Naramsim commented 2 years ago

https://github.com/SchoofsKelvin/vscode-sshfs/blob/bd25e7322dee43f2e70b189e102c22b49d69884e/src/manager.ts#L20

It would be cool to have the possibility to declare an array instead of a single string. So to launch commands on multiple machines

Thanks so much for this extension!

SchoofsKelvin commented 2 years ago

While this could be added, it wouldn't be ideal and very logical. How should output be shown and made distinct per server? What if one of the hosts is unreachable or exits mid-task? And so on.

VS Code already supports something called compound tasks, which you could use for this:

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Run on all servers",
            "dependsOn": [
                "Server A",
                "Server B"
            ]
        },
        {
            "type": "ssh-shell",
            "label": "Server A",
            "command": "echo Running on server A which is $HOSTNAME",
            "host": "server-a"
        },
        {
            "type": "ssh-shell",
            "label": "Server B",
            "command": "echo Running on server B which is $HOSTNAME",
            "host": "server-b"
        }
    ]
}