我正在尝试使用vs代码任务来自动化我的构建。打开新终端时,我需要运行:
setupBuild.bat
runBuild.bat
setupBuild.bat
会花费一些时间,并设置runBuild.bat
所需的一堆变量。然后,我可以仅使用runBuild.bat
来运行增量构建。我读过here,说我可以使用env
选项将变量提供给runBuild.bat
,但是我不知道如何从setupBuild.bat
中提取变量(以某种方式传递标准输出)来自printenv
?)。
我该如何解决这个问题?我看到有一个isBackground
选项,但是我认为我不能用它来持久化shell子进程并向其提供新命令。
{
"version": "2.0.0",
"tasks": [
{
"label": "Setup build",
"type": "shell",
"command": "setupBuild.bat"
},
{
"label": "Run build",
"type": "shell",
"command": "runBuild.bat"
}
]
}