File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { exec } from "node:child_process" ;
2-
31import { createLoginSession } from "../auth" ;
42import { createCommand , type CommandConfig } from "../lib/command" ;
3+ import { openBrowser } from "../lib/browser" ;
54
65const 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- }
Original file line number Diff line number Diff line change @@ -2,6 +2,6 @@ import { exec } from "node:child_process";
22
33export 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}
You can’t perform that action at this time.
0 commit comments