Skip to content
This repository was archived by the owner on Nov 15, 2024. It is now read-only.

Commit 8a7143f

Browse files
committed
Trim command prefix
1 parent c592724 commit 8a7143f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/cli/browser.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ class BrowserCLI extends (EventEmitter as unknown as new () => TypedEmitter<CLIE
3838
? input
3939
: `${input} --api-key ${this.apiKey}`
4040

41+
const inputWithKeyAndWithoutPrefix = inputWithKey.startsWith("seam ")
42+
? inputWithKey.replace("seam ", "")
43+
: inputWithKey.startsWith("seamapi ")
44+
? inputWithKey.replace("seamapi ", "")
45+
: inputWithKey
46+
4147
await new Promise<void>((resolve, reject) => {
4248
// .parseAsync isn't available in v16, so we listen for the ending newline instead
4349
const onData = (data: string) => {
@@ -49,7 +55,7 @@ class BrowserCLI extends (EventEmitter as unknown as new () => TypedEmitter<CLIE
4955
this.on("data", onData)
5056

5157
this.instance.parse(
52-
inputWithKey,
58+
inputWithKeyAndWithoutPrefix,
5359
(error: Error, _argv: any, output?: string) => {
5460
if (error) {
5561
this.removeListener("data", onData)

0 commit comments

Comments
 (0)