fix(testing): use UUIDs for npm update guest scripts · openclaw/openclaw@40bd375
vincentkoc
·
2026-06-17
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | #!/usr/bin/env -S pnpm tsx |
2 | 2 | // Npm Update Smoke script supports OpenClaw repository automation. |
| 3 | +import { randomUUID } from "node:crypto"; |
3 | 4 | import { spawn } from "node:child_process"; |
4 | 5 | import { appendFileSync, existsSync, readFileSync, writeFileSync } from "node:fs"; |
5 | 6 | import { copyFile, readFile, rm } from "node:fs/promises"; |
@@ -1098,7 +1099,7 @@ export class NpmUpdateSmoke {
|
1098 | 1099 | } |
1099 | 1100 | |
1100 | 1101 | private writeGuestScript(vm: string, script: string, prefix: string): string { |
1101 | | -const scriptPath = `/tmp/${prefix}-${process.pid}-${Date.now()}.sh`; |
| 1102 | +const scriptPath = `/tmp/${prefix}-${randomUUID()}.sh`; |
1102 | 1103 | const write = run("prlctl", ["exec", vm, "/usr/bin/tee", scriptPath], { |
1103 | 1104 | check: false, |
1104 | 1105 | input: script, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。