Skip to content

Commit 8c07845

Browse files
committed
refactor: tighten ts-topology entrypoint guard
1 parent 7728ab9 commit 8c07845

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

scripts/ts-topology.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ export async function main(argv: string[], io: IoLike = process): Promise<number
168168
}
169169
}
170170

171-
if (import.meta.url === pathToFileURL(process.argv[1] ?? "").href) {
171+
const entrypointPath = process.argv[1];
172+
if (entrypointPath && import.meta.url === pathToFileURL(entrypointPath).href) {
172173
const exitCode = await main(process.argv.slice(2));
173174
if (exitCode !== 0) {
174175
process.exit(exitCode);

test/scripts/openclaw-cross-os-release-workflow.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,6 @@ describe("cross-OS release checks workflow", () => {
349349
expect(packageJson.scripts["test:windows:ci"]).toContain(
350350
"test/scripts/openclaw-cross-os-release-workflow.test.ts",
351351
);
352-
expect(packageJson.scripts["test:windows:ci"]).toContain("test/scripts/ts-topology.test.ts");
353-
354352
const result = spawnSync(
355353
BASH_BIN,
356354
[

test/scripts/ts-topology.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { spawnSync } from "node:child_process";
21
// Ts Topology tests cover ts topology script behavior.
2+
import { spawnSync } from "node:child_process";
33
import path from "node:path";
44
import { describe, expect, it } from "vitest";
55
import { analyzeTopology, filterRecordsForReport } from "../../scripts/lib/ts-topology/analyze.js";

0 commit comments

Comments
 (0)