实测踩到:服务器上脚本是旧版,运行时 git pull 拉到了新版,但**本次进程跑的仍是内存里 已载入的旧版函数** —— 文件已经是 curl -sL 了,报错文案却还是旧版的,排查了一轮才明白。 包在 main() 里解决的是「bash 边读边执行、pull 后按新文件字节偏移读后半段」的错位问题 (deploy-prod.sh 头部注释记的那个);但它防不了「这一轮跑的是旧逻辑」—— 函数在调用前就已整体载入内存,pull 换掉磁盘文件不影响已载入的定义。 修法:pull 前后比对本文件的 blob hash,变了就 exec bash "$0" --no-pull 用新版重跑, --no-pull 同时防无限递归。
| Name |
Last commit
|
Last update |
|---|---|---|
| .claude | Loading commit data... | |
| .design-sync | Loading commit data... | |
| apps | Loading commit data... | |
| clickhouse/config.d | Loading commit data... | |
| deploy | Loading commit data... | |
| docs | Loading commit data... | |
| packages | Loading commit data... | |
| scripts | Loading commit data... | |
| .gitignore | Loading commit data... | |
| .gitlab-ci.yml | Loading commit data... | |
| .npmrc | Loading commit data... | |
| .prettierrc | Loading commit data... | |
| README.md | Loading commit data... | |
| docker-compose.expose.yml | Loading commit data... | |
| docker-compose.managed.yml | Loading commit data... | |
| docker-compose.prod.yml | Loading commit data... | |
| docker-compose.yml | Loading commit data... | |
| eslint.config.mjs | Loading commit data... | |
| liu.cjs | Loading commit data... | |
| package.json | Loading commit data... | |
| pnpm-lock.yaml | Loading commit data... | |
| pnpm-workspace.yaml | Loading commit data... | |
| tsconfig.base.json | Loading commit data... | |
| turbo.json | Loading commit data... |