Skip to content

Commit e7a3562

Browse files
committed
fix(tickets): allow passthrough flags on hack tickets
1 parent 2d89ebd commit e7a3562

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

src/cli/run.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ export async function runCli(argv: readonly string[]): Promise<number> {
4040
return parsed.positionals.length === 0 ? 1 : 1;
4141
}
4242

43-
const isExtensionDispatcher = resolved.command?.name === "x";
43+
const isExtensionDispatcher =
44+
resolved.command?.name === "x" || resolved.command?.name === "tickets";
4445
if (!isExtensionDispatcher) {
4546
// Unknown options (not registered anywhere in the CLI)
4647
const unionOptNames = collectUnionOptionNames(cli);
@@ -118,7 +119,7 @@ function isExtensionDispatch(opts: {
118119
if (token.startsWith("-")) {
119120
continue;
120121
}
121-
return token === "x";
122+
return token === "x" || token === "tickets";
122123
}
123124
return false;
124125
}

src/commands/update.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import { ensureDir } from "../lib/fs.ts";
99
import {
1010
compareVersions,
1111
downloadAndExtractRelease,
12-
isDevWrapperShimBytes,
1312
installExtractedRelease,
13+
isDevWrapperShimBytes,
1414
resolveGithubRelease,
1515
resolveUpdateTarget,
1616
selectCliTarballAsset,
@@ -306,7 +306,10 @@ async function resolveSelfUpdateBinaryPath(): Promise<
306306
// Detect local dev shim installs (a bash wrapper script), but avoid false positives for compiled
307307
// binaries (which embed the marker string in their own data segment).
308308
const file = Bun.file(candidate);
309-
const prefixBuf = await file.slice(0, 2).arrayBuffer().catch(() => null);
309+
const prefixBuf = await file
310+
.slice(0, 2)
311+
.arrayBuffer()
312+
.catch(() => null);
310313
if (prefixBuf) {
311314
const prefix = new Uint8Array(prefixBuf);
312315
const isShebang =

tests/tickets-extension.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ testIntegration(
6767

6868
const created = await runHack({
6969
cwd: projectDir,
70-
args: ["x", "tickets", "create", "--title", "First ticket", "--json"],
70+
args: ["tickets", "create", "--title", "First ticket", "--json"],
7171
});
7272
const createdJson = JSON.parse(created.stdout) as {
7373
ticket: { ticketId: string };
@@ -84,7 +84,7 @@ testIntegration(
8484

8585
const listed = await runHack({
8686
cwd: projectDir,
87-
args: ["x", "tickets", "list", "--json"],
87+
args: ["tickets", "list", "--json"],
8888
});
8989
const listJson = JSON.parse(listed.stdout) as {
9090
tickets: { ticketId: string; title: string }[];
@@ -94,7 +94,7 @@ testIntegration(
9494

9595
const shown = await runHack({
9696
cwd: projectDir,
97-
args: ["x", "tickets", "show", createdJson.ticket.ticketId, "--json"],
97+
args: ["tickets", "show", createdJson.ticket.ticketId, "--json"],
9898
});
9999
const showJson = JSON.parse(shown.stdout) as {
100100
ticket: { ticketId: string; title: string };

0 commit comments

Comments
 (0)