惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - Franky
J
Java Code Geeks
腾讯CDC
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Jina AI
Jina AI
博客园 - 司徒正美
Stack Overflow Blog
Stack Overflow Blog
美团技术团队
L
LangChain Blog
WordPress大学
WordPress大学
A
About on SuperTechFans
Martin Fowler
Martin Fowler
月光博客
月光博客
Y
Y Combinator Blog
U
Unit 42
D
Docker
Recent Announcements
Recent Announcements
Hugging Face - Blog
Hugging Face - Blog
B
Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
G
Google Developers Blog
Last Week in AI
Last Week in AI
T
The Blog of Author Tim Ferriss
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(test): guard platform sync cli values · openclaw/open...
vincentkoc · 2026-06-20 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -4,7 +4,8 @@ import { syncAndroidVersioning } from "./lib/android-version.ts";

44
55

type Mode = "check" | "write";

66
7-

export function parseArgs(argv: string[]): { mode: Mode; rootDir: string } {

7+

export function parseArgs(argv: string[]): { help: boolean; mode: Mode; rootDir: string } {

8+

let help = false;

89

let mode: Mode = "write";

910

let rootDir = path.resolve(".");

1011

@@ -20,39 +21,62 @@ export function parseArgs(argv: string[]): { mode: Mode; rootDir: string } {

2021

break;

2122

}

2223

case "--root": {

23-

const value = argv[index + 1];

24-

if (!value) {

25-

throw new Error("Missing value for --root.");

26-

}

27-

rootDir = path.resolve(value);

24+

rootDir = path.resolve(readOptionValue(argv, index, "--root"));

2825

index += 1;

2926

break;

3027

}

3128

case "-h":

3229

case "--help": {

33-

console.log(

34-

"Usage: node --import tsx scripts/android-sync-versioning.ts [--write|--check] [--root dir]",

35-

);

36-

process.exit(0);

30+

help = true;

31+

break;

3732

}

3833

default: {

3934

throw new Error(`Unknown argument: ${arg}`);

4035

}

4136

}

4237

}

4338
44-

return { mode, rootDir };

39+

return { help, mode, rootDir };

4540

}

4641
47-

const options = parseArgs(process.argv.slice(2));

48-

const result = syncAndroidVersioning({ mode: options.mode, rootDir: options.rootDir });

42+

function readOptionValue(argv: string[], index: number, flag: string): string {

43+

const value = argv[index + 1];

44+

if (!value || value.startsWith("--")) {

45+

throw new Error(`Missing value for ${flag}.`);

46+

}

47+

return value;

48+

}

4949
50-

if (options.mode === "check") {

51-

process.stdout.write("Android versioning artifacts are up to date.\n");

52-

} else if (result.updatedPaths.length === 0) {

53-

process.stdout.write("Android versioning artifacts already up to date.\n");

54-

} else {

50+

function printUsage(): void {

5551

process.stdout.write(

56-

`Updated Android versioning artifacts:\n- ${result.updatedPaths.map((filePath) => path.relative(process.cwd(), filePath)).join("\n- ")}\n`,

52+

"Usage: node --import tsx scripts/android-sync-versioning.ts [--write|--check] [--root dir]\n",

5753

);

5854

}

55+
56+

function main(argv = process.argv.slice(2)): number {

57+

const options = parseArgs(argv);

58+

if (options.help) {

59+

printUsage();

60+

return 0;

61+

}

62+
63+

const result = syncAndroidVersioning({ mode: options.mode, rootDir: options.rootDir });

64+
65+

if (options.mode === "check") {

66+

process.stdout.write("Android versioning artifacts are up to date.\n");

67+

} else if (result.updatedPaths.length === 0) {

68+

process.stdout.write("Android versioning artifacts already up to date.\n");

69+

} else {

70+

process.stdout.write(

71+

`Updated Android versioning artifacts:\n- ${result.updatedPaths.map((filePath) => path.relative(process.cwd(), filePath)).join("\n- ")}\n`,

72+

);

73+

}

74+

return 0;

75+

}

76+
77+

try {

78+

process.exitCode = main();

79+

} catch (error) {

80+

process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);

81+

process.exitCode = 1;

82+

}

Original file line numberDiff line numberDiff line change

@@ -4,7 +4,8 @@ import { syncIosVersioning } from "./lib/ios-version.ts";

44
55

type Mode = "check" | "write";

66
7-

export function parseArgs(argv: string[]): { mode: Mode; rootDir: string } {

7+

export function parseArgs(argv: string[]): { help: boolean; mode: Mode; rootDir: string } {

8+

let help = false;

89

let mode: Mode = "write";

910

let rootDir = path.resolve(".");

1011

@@ -20,39 +21,62 @@ export function parseArgs(argv: string[]): { mode: Mode; rootDir: string } {

2021

break;

2122

}

2223

case "--root": {

23-

const value = argv[index + 1];

24-

if (!value) {

25-

throw new Error("Missing value for --root.");

26-

}

27-

rootDir = path.resolve(value);

24+

rootDir = path.resolve(readOptionValue(argv, index, "--root"));

2825

index += 1;

2926

break;

3027

}

3128

case "-h":

3229

case "--help": {

33-

console.log(

34-

"Usage: node --import tsx scripts/ios-sync-versioning.ts [--write|--check] [--root dir]",

35-

);

36-

process.exit(0);

30+

help = true;

31+

break;

3732

}

3833

default: {

3934

throw new Error(`Unknown argument: ${arg}`);

4035

}

4136

}

4237

}

4338
44-

return { mode, rootDir };

39+

return { help, mode, rootDir };

4540

}

4641
47-

const options = parseArgs(process.argv.slice(2));

48-

const result = syncIosVersioning({ mode: options.mode, rootDir: options.rootDir });

42+

function readOptionValue(argv: string[], index: number, flag: string): string {

43+

const value = argv[index + 1];

44+

if (!value || value.startsWith("--")) {

45+

throw new Error(`Missing value for ${flag}.`);

46+

}

47+

return value;

48+

}

4949
50-

if (options.mode === "check") {

51-

process.stdout.write("iOS versioning artifacts are up to date.\n");

52-

} else if (result.updatedPaths.length === 0) {

53-

process.stdout.write("iOS versioning artifacts already up to date.\n");

54-

} else {

50+

function printUsage(): void {

5551

process.stdout.write(

56-

`Updated iOS versioning artifacts:\n- ${result.updatedPaths.map((filePath) => path.relative(process.cwd(), filePath)).join("\n- ")}\n`,

52+

"Usage: node --import tsx scripts/ios-sync-versioning.ts [--write|--check] [--root dir]\n",

5753

);

5854

}

55+
56+

function main(argv = process.argv.slice(2)): number {

57+

const options = parseArgs(argv);

58+

if (options.help) {

59+

printUsage();

60+

return 0;

61+

}

62+
63+

const result = syncIosVersioning({ mode: options.mode, rootDir: options.rootDir });

64+
65+

if (options.mode === "check") {

66+

process.stdout.write("iOS versioning artifacts are up to date.\n");

67+

} else if (result.updatedPaths.length === 0) {

68+

process.stdout.write("iOS versioning artifacts already up to date.\n");

69+

} else {

70+

process.stdout.write(

71+

`Updated iOS versioning artifacts:\n- ${result.updatedPaths.map((filePath) => path.relative(process.cwd(), filePath)).join("\n- ")}\n`,

72+

);

73+

}

74+

return 0;

75+

}

76+
77+

try {

78+

process.exitCode = main();

79+

} catch (error) {

80+

process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);

81+

process.exitCode = 1;

82+

}

Original file line numberDiff line numberDiff line change

@@ -62,6 +62,20 @@ describe("resolveAndroidVersion", () => {

6262

expect(result.stderr).toBe("");

6363

});

6464
65+

it("rejects missing Android sync CLI root values before reading version files", () => {

66+

const result = spawnSync(

67+

process.execPath,

68+

["--import", "tsx", "scripts/android-sync-versioning.ts", "--root", "--check"],

69+

{

70+

cwd: process.cwd(),

71+

encoding: "utf8",

72+

},

73+

);

74+
75+

expect(result.status).toBe(1);

76+

expect(result.stderr).toBe("Missing value for --root.\n");

77+

});

78+
6579

it("parses pinned release versions and Android version codes", () => {

6680

const rootDir = writeAndroidFixture({

6781

version: "2026.6.2",

Original file line numberDiff line numberDiff line change

@@ -58,6 +58,20 @@ describe("resolveIosVersion", () => {

5858

expect(result.stderr).toBe("");

5959

});

6060
61+

it("rejects missing iOS sync CLI root values before reading version files", () => {

62+

const result = spawnSync(

63+

process.execPath,

64+

["--import", "tsx", "scripts/ios-sync-versioning.ts", "--root", "--check"],

65+

{

66+

cwd: process.cwd(),

67+

encoding: "utf8",

68+

},

69+

);

70+
71+

expect(result.status).toBe(1);

72+

expect(result.stderr).toBe("Missing value for --root.\n");

73+

});

74+
6175

it("parses pinned release versions and derives Apple marketing fields", () => {

6276

const rootDir = writeIosFixture({

6377

version: "2026.4.6",