Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): Reveal in File Explorer and browser launches work on Windows again #19656

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 10 commits intomain fromrefs/pull/19656/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 2 changed files with 134 additions and 58 deletions (loading 1).

x
0 of 2 viewed, 2 left
134 additions and 58 deletionsapps/server/src/process/externalLauncher.test.tsModified
View file
@@ -1,5 +1,4 @@
-// @effect-diagnostics nodeBuiltinImport:off - the Windows reveal smoke test drives a real PowerShell through Node process and filesystem APIs.
-import * as NodeChildProcess from "node:child_process";
+// @effect-diagnostics nodeBuiltinImport:off - the Windows launch smoke tests use filesystem notifications to observe real PowerShell launches.
import * as NodeFS from "node:fs";
import * as NodeOS from "node:os";
import * as NodePath from "node:path";
@@ -124,6 +123,50 @@
});
​
+it.effect.each(["win32", "linux"] as const)(
+ "launches the browser through PowerShell on %s",
+ (platform) => {
+ let spawned: ChildProcess.StandardCommand | undefined;
+ return Effect.gen(function* () {
+ const launcher = yield* ExternalLauncher.ExternalLauncher;
+​
+ yield* launcher.launchBrowser("https://example.com/some path");
+​
+ assert.ok(spawned);
+ assert.equal(
+ spawned.command,
+ platform === "win32"
+ ? "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"
+ : "/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe",
+ );
+ assert.deepEqual(spawned.args.slice(0, -1), [
+ "-NoProfile",
+ "-NonInteractive",