github代码设置启动终端,并在启动时命令

发布于 2025-02-11 00:55:22 字数 133 浏览 0 评论 0原文

有谁知道一种配置GitHub代码的方法,以在启动时使用命令(例如“ NPM启动”)运行自动多个终端?

我已经尝试使用配置终端文件的VS-CODE扩展“终端管理器”,但它仅在普通VS-CODE中起作用。不在代码方面。

提前致谢

does anyone know a way to configure Github codespaces to run automatic multiple terminals with commands (eg. "npm start") on startup?

I already tried the VS-Code extension "Terminal Manager" with configured terminals.json file, but it works just in normal VS-Code. Not in Codespaces.

Thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

永不分离 2025-02-18 00:55:22

您可以使用PostCreateCommand

此命令是创建开发容器时最终完成容器设置的三个命令。

如果您有一个脚本,则可以在使用此语法创建的容器之后运行:

{
  "postCreateCommand": "npm start"
}

// or

{
  "postCreateCommand": ["npm", "start"]
}

如果您具有乘数命令,则可以使用&&&

{
  "postCreateCommand": "npm install && npm start"
}

devcontainer refernce
devcontainer lifecycle scripts


You can use postCreateCommand

This command is the last of three that finalizes container setup when a dev container is created.

If you have one script you can run after container created with this syntax:

{
  "postCreateCommand": "npm start"
}

// or

{
  "postCreateCommand": ["npm", "start"]
}

if you have multiply command you can separate commands with &&:

{
  "postCreateCommand": "npm install && npm start"
}

Devcontainer refernce
Devcontainer Lifecycle scripts
String vs array in devcontainer.json
Github issue

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文