batch-file - VSCode构建任务打开shell并停止而不运行命令
问题描述
我目前正在尝试运行一个 build.bat 脚本,该脚本使用 VSCode 构建任务构建我的解决方案。不幸的是,它所做的只是打开命令提示符,而不按照说明运行实际命令。我目前正在尝试运行的任务是
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"windows": {
"options": {
"cwd": "W:\\handmade\\code",
"shell": {
"args": [
"/k W:\\handmade\\misc\\shell.bat"
]
}
},
"command": "build.bat",
},
"problemMatcher": [
"$gcc"
]
}
]
}
我期望的输出是:
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.8.4
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
W:\handmade\code>build.bat
A subdirectory or file ..\..\build already exists.
Microsoft (R) C/C++ Optimizing Compiler Version 19.15.26729 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
win32_handmade.cpp
Microsoft (R) Incremental Linker Version 14.15.26729.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:win32_handmade.exe
/debug
win32_handmade.obj
user32.lib
如果我正常运行命令,我会得到什么,而我得到的是
> Executing task: build.bat <
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.8.4
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
W:\handmade\code>
然后它挂起,直到调用退出。tasks.json 中提供的命令显然从未尝试执行过,我不知道为什么会这样。
解决方案
推荐阅读
- javascript - 如何隐藏 varbinary 图像以在 React js 中呈现?
- php - 电子邮件刀片有未定义的变量:使用 Laravel 队列时
- java - 具有矩形层的球碰撞逻辑
- python - 我们如何使用 numpy 生成 300 到 3000 之间的随机数?
- google-cloud-platform - 如何将 bigquery 表复制到谷歌云 postgres 中?
- php - 在 CodeIgniter 4 中使用正在运行的聊天应用程序时出错
- angular - 无法使用 ngx-sharebuttons 将 URL 属性绑定到 html 页面
- coq - 与自然数列表的最大元素的小于或等于关系
- python - 为什么调用 super().foo 和 super().__getattribute__("foo") 有区别
- c# - 模型状态立即返回 .Net Core 5