From 4fa1ddf22fc3c3633d28c599076def22702a93a3 Mon Sep 17 00:00:00 2001 From: chenhang Date: Fri, 12 Jun 2026 14:40:07 +0800 Subject: [PATCH] chore(hooks): copy env example to production env in post-receive Add preparation step for production environment variables by copying .env.production.example to .env.production before running build:start, ensuring required environment variables are available on deployment. --- git_hooks/post-receive | 3 +++ 1 file changed, 3 insertions(+) diff --git a/git_hooks/post-receive b/git_hooks/post-receive index 36c8fdca..55a9ee71 100755 --- a/git_hooks/post-receive +++ b/git_hooks/post-receive @@ -8,4 +8,7 @@ # - 内部 = `npm run build && npm run start` # - 实际调用 `pnpm run build:start`(项目使用 pnpm) +# 准备生产环境变量(从 .env.production.example 复制 → .env.production) +cp -f .env.production.example .env.production + pnpm run build:start