How to run a command in Visual Studio Code with launch.json

前端 未结 4 2075
刺人心
刺人心 2020-12-03 00:38

Is there a way to execute an ssh command when debugging a project with .vscode/launch.json?

For example: ssh -i xxxxx.

O

4条回答
  •  执笔经年
    2020-12-03 01:06

    For me, I just needed an environment variable, which is different. You don't want a task for this because (at least for me) it doesn't work when the launcher is run.

    Thanks to here, I got it working like this, inside my launcher (launch.json) entry:

    "environment": [{
        "name": "ENVIRONMENT_VARIABLE_NAME",
        "value": "${workspaceFolder}/lib" //Set to whatever value you want.
    }],
    

提交回复
热议问题