Skip to content

Commit d418cc9

Browse files
authored
fix(win32): don't open extra terminal (#159)
Co-authored-by: lihbr <lihbr@users.noreply.github.com>
1 parent 3f53653 commit d418cc9

2 files changed

Lines changed: 2 additions & 9 deletions

File tree

src/commands/login.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { exec } from "node:child_process";
2-
31
import { createLoginSession } from "../auth";
42
import { createCommand, type CommandConfig } from "../lib/command";
3+
import { openBrowser } from "../lib/browser";
54

65
const config = {
76
name: "prismic login",
@@ -28,9 +27,3 @@ export default createCommand(config, async ({ values }) => {
2827

2928
console.info(`Logged in to Prismic as ${email}`);
3029
});
31-
32-
function openBrowser(url: URL): void {
33-
const cmd =
34-
process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
35-
exec(`${cmd} "${url.toString()}"`);
36-
}

src/lib/browser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ import { exec } from "node:child_process";
22

33
export function openBrowser(url: URL): void {
44
const cmd =
5-
process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
5+
process.platform === "darwin" ? "open" : process.platform === "win32" ? 'start ""' : "xdg-open";
66
exec(`${cmd} "${url.toString()}"`);
77
}

0 commit comments

Comments
 (0)