简体   繁体   English

Visual Studio 代码中的发布后任务

[英]post launch task in visual studio code

I can launch task before debug my node app in vscode with preLaunchTask arg in launch.json but I can't find a way to launch task after the debug.我可以在使用 launch.json 中的 preLaunchTask arg 在 vscode 中调试我的节点应用程序之前启动任务,但在调试后我找不到启动任务的方法。 Is there a way to do this in vscode like with the preLaunchTask?有没有办法像 preLaunchTask 一样在 vscode 中做到这一点?

v1.22 just added a postDebugTask , release notes: postDebugTask . v1.22 刚刚添加了一个postDebugTask发布说明: postDebugTask

We have added postDebugTask support in launch.json.我们在 launch.json 中添加了 postDebugTask 支持。 This task is run after a debug session finishes.此任务在调试会话完成后运行。 Similar to preLaunchTask, you can reference tasks in your tasks.json by a name.与 preLaunchTask 类似,您可以通过名称引用 tasks.json 中的任务。 Here's an example of a launch configuration using a postDebugTask:以下是使用 postDebugTask 的启动配置示例:

{
    "name": "Attach to node server",
    "type": "node",
    "request": "attach",
    "port": 8008,
    "preLaunchTask": "Start Server",
    "postDebugTask": "Your delete task here"
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 可以将 Visual Studio Code 配置为使用 nodemon 启动吗 - Can Visual Studio Code be configured to launch with nodemon Visual Studio Code Node.js调试失败-请求``启动'':无法启动 - Visual studio code nodejs debug failure - request 'launch': cannot launch 使用“preLaunchTasks”并在Visual Studio代码中命名任务 - Using “preLaunchTasks” and Naming a Task in Visual Studio Code 无法在 Visual Studio 代码中为“npx”启动的应用程序启动调试 - Unable to launch Debugging for a "npx" launched App in visual studio code Visual Studio Code - launch.json 和调试器卡在 Python 上 - Visual Studio Code - launch.json and debugger is stuck on Python 运行工头从视觉工作室代码launch.json开始 - Running foreman start through visual studio code launch.json 如何在launch.json的Visual Studio Code中反转${relativeFile}中的反斜杠? - How to reverse backslashes in ${relativeFile} in Visual Studio Code in launch.json? 在 Visual Studio Code 中启用详细调试以启动.json - Enable verbose debugging to launch.json in Visual Studio Code 在 Visual Studio Code 中,如何在 launch.json 中传递 arguments - In Visual Studio Code, how to pass arguments in launch.json visual studio code nodejs请求'launch':无法启动目标(原因:spawn节点ENOENT) - visual studio code nodejs request 'launch': cannot launch target (reason: spawn node ENOENT)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM