refactor: devcontainer
Some checks failed
CI/CD Pipeline / playwright (push) Successful in 2m40s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m55s
测试最新依赖 / build-and-test (push) Successful in 1m30s
测试最新依赖 / playwright (push) Failing after 2m12s

This commit is contained in:
严浩
2025-11-23 00:00:26 +08:00
parent 4a5ae8d2de
commit 814130af34
9 changed files with 2912 additions and 2470 deletions

View File

@@ -0,0 +1,14 @@
#!/bin/zsh -eu
# 打印带有颜色的欢迎信息
echo -e "\033[1;32m↘ 容器首次创建!\033[0m"
# 修复权限问题(比如 node_modules 目录)
sudo chown -R $(whoami):$(whoami) /workspaces || true
# 调用内置命令 (这些命令在 _build-context/builtin-scripts 目录中的脚本中定义)
h-setup-locale
h-setup-zsh
h-setup-bun-bin
h-setup-ai-tools
h-setup-pnpm-bin

View File

@@ -0,0 +1,13 @@
#!/bin/bash -eu
# 容器内容更新时的消息和依赖安装
echo '↘️ 容器内容已更新!'
# 安装依赖
if command -v pnpm >/dev/null 2>&1; then
# 跳过: The modules directory at "/workspaces/h-devcontainers/node_modules" will be removed and reinstalled from scratch. Proceed? (Y/n) ·
time pnpm install --config.confirmModulesPurge=false
else
echo '❌错误: pnpm 未安装'
exit 0
fi