Windows Bash and Visual Studio Code: How can I launch bash as a run task?

前端 未结 3 970
醉梦人生
醉梦人生 2020-12-16 03:00

how can I run the Windows Bash from Visual Studio code as a run task?

Here are some of my many attempts at tasks.json to do this.

{
           


        
3条回答
  •  生来不讨喜
    2020-12-16 03:27

    Try:

    {
        "version": "0.1.0",
        "command": "bash",
        "isShellCommand": true,
        "args": [ "myShellScript.sh" ],
        "showOutput": "always"
    }
    

    Or you can add a shebang to your file:

    #!/bin/bash
    

    and then write the path to the script:

    {
        "version": "0.1.0",
        "command": "/path/to/script.sh",
        "isShellCommand": true,
        "args": [],
        "showOutput": "always"
    }
    

提交回复
热议问题