fix(release): guard appcast cleanup before notes path · openclaw/openclaw@abd5fb4
vincentkoc
·
2026-06-21
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -39,9 +39,10 @@ if [[ -z "$VERSION" ]]; then
|
39 | 39 | fi |
40 | 40 | |
41 | 41 | TMP_DIR="$(mktemp -d)" |
| 42 | +NOTES_HTML="" |
42 | 43 | cleanup() { |
43 | 44 | rm -rf "$TMP_DIR" |
44 | | -if [[ "${KEEP_SPARKLE_NOTES:-0}" != "1" ]]; then |
| 45 | +if [[ -n "$NOTES_HTML" && "${KEEP_SPARKLE_NOTES:-0}" != "1" ]]; then |
45 | 46 | rm -f "$NOTES_HTML" |
46 | 47 | fi |
47 | 48 | } |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -737,6 +737,7 @@ const TOOLING_SOURCE_TEST_TARGETS = new Map([
|
737 | 737 | ["scripts/ios-run.sh", ["test/scripts/ios-run.test.ts"]], |
738 | 738 | ["scripts/create-dmg.sh", ["test/scripts/create-dmg.test.ts"]], |
739 | 739 | ["scripts/kova-ci-summary.mjs", ["test/scripts/kova-ci-summary.test.ts"]], |
| 740 | +["scripts/make_appcast.sh", ["test/scripts/make-appcast.test.ts"]], |
740 | 741 | ["scripts/openclaw-npm-postpublish-verify.ts", ["test/openclaw-npm-postpublish-verify.test.ts"]], |
741 | 742 | ["scripts/openclaw-npm-release-check.ts", ["test/openclaw-npm-release-check.test.ts"]], |
742 | 743 | ["scripts/openclaw-prepack.ts", ["test/openclaw-prepack.test.ts"]], |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +// Make Appcast tests cover release appcast script behavior. |
| 2 | +import { readFileSync } from "node:fs"; |
| 3 | +import { describe, expect, it } from "vitest"; |
| 4 | + |
| 5 | +const scriptPath = "scripts/make_appcast.sh"; |
| 6 | + |
| 7 | +describe("make_appcast cleanup", () => { |
| 8 | +it("does not reference release notes before their path is assigned", () => { |
| 9 | +const script = readFileSync(scriptPath, "utf8"); |
| 10 | +const setupBlock = script.slice( |
| 11 | +script.indexOf('TMP_DIR="$(mktemp -d)"'), |
| 12 | +script.indexOf('cp -f "$ZIP" "$TMP_DIR/$ZIP_NAME"'), |
| 13 | +); |
| 14 | + |
| 15 | +expect(setupBlock).toContain('NOTES_HTML=""'); |
| 16 | +expect(setupBlock.indexOf('NOTES_HTML=""')).toBeLessThan( |
| 17 | +setupBlock.indexOf("trap cleanup EXIT"), |
| 18 | +); |
| 19 | +expect(setupBlock).toContain( |
| 20 | +'if [[ -n "$NOTES_HTML" && "${KEEP_SPARKLE_NOTES:-0}" != "1" ]]; then', |
| 21 | +); |
| 22 | +expect(setupBlock).toContain('rm -f "$NOTES_HTML"'); |
| 23 | +}); |
| 24 | +}); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1184,6 +1184,7 @@ describe("scripts/test-projects changed-target routing", () => {
|
1184 | 1184 | ], |
1185 | 1185 | ["scripts/ios-run.sh", ["test/scripts/ios-run.test.ts"]], |
1186 | 1186 | ["scripts/create-dmg.sh", ["test/scripts/create-dmg.test.ts"]], |
| 1187 | +["scripts/make_appcast.sh", ["test/scripts/make-appcast.test.ts"]], |
1187 | 1188 | ["scripts/package-mac-app.sh", ["test/scripts/package-mac-app.test.ts"]], |
1188 | 1189 | ["scripts/package-mac-dist.sh", ["test/scripts/package-mac-dist.test.ts"]], |
1189 | 1190 | ["scripts/package-changelog.mjs", ["test/scripts/package-changelog.test.ts"]], |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。