Skip to content

Commit 3d0ba0f

Browse files
authored
fix: Windows support for automatic token provisioning (#257)
1 parent 28e8488 commit 3d0ba0f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/utils/access_token.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ async function provision(): Promise<string> {
4444

4545
wait("").start().info(`Authorization URL: ${url}`);
4646
let openCmd;
47+
const args = [];
4748
// TODO(arnauorriols): use npm:open or deno.land/x/open when either is compatible
4849
switch (Deno.build.os) {
4950
case "darwin": {
@@ -55,15 +56,18 @@ async function provision(): Promise<string> {
5556
break;
5657
}
5758
case "windows": {
58-
openCmd = "start";
59+
// Windows Start-Process is a cmdlet of PowerShell
60+
openCmd = "PowerShell.exe";
61+
args.push("Start-Process");
5962
break;
6063
}
6164
}
65+
args.push(url);
6266
let open;
6367
if (openCmd !== undefined) {
6468
try {
6569
open = new Deno.Command(openCmd, {
66-
args: [url],
70+
args,
6771
stderr: "piped",
6872
stdout: "piped",
6973
})

0 commit comments

Comments
 (0)