Skip to content

Commit 51b10e7

Browse files
committed
fix(script): parse JSON output
1 parent e4a475a commit 51b10e7

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

scripts/package_automation.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ class TangramClient {
7676
.text()
7777
.then((t) => t.trim());
7878

79-
// Output can be either just a process ID or "processId cancellationToken"
80-
const parts = output.split(/\s+/);
81-
if (parts.length === 1) {
82-
return { id: parts[0] };
79+
const result = JSON.parse(output);
80+
const returnValue: { id: string; token?: string } = { id: result.process };
81+
if (result.token) {
82+
returnValue.token = result.token;
8383
}
84-
return { id: parts[0], token: parts[1] };
84+
return returnValue;
8585
}
8686

8787
async processOutput(processId: string): Promise<string> {
@@ -239,11 +239,11 @@ const USAGE = `Usage: bun run scripts/package_automation.ts <flags> [packages]
239239
This script can run one or more actions on one or more packages with enhanced flexibility.
240240
241241
Examples:
242-
# Run all steps on all packages (excludes format)
242+
# Run all check, build, and test on all packages
243243
bun run scripts/package_automation.ts
244244
245245
# Run specific actions on specific packages
246-
bun run scripts/package_automation.ts -t ripgrep jq
246+
bun run scripts/package_automation.ts -r ripgrep jq
247247
248248
# Format and test (format must be explicitly requested)
249249
bun run scripts/package_automation.ts -ft ripgrep
@@ -319,7 +319,7 @@ function parseFromArgs(): Configuration {
319319

320320
// Default actions if none specified
321321
if (actions.length === 0) {
322-
actions.push("check", "build", "test", "publish", "release");
322+
actions.push("test");
323323
}
324324

325325
// Process export flags - multiple: true ensures it's always an array or undefined

0 commit comments

Comments
 (0)