Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(cli): npx t3 now steers you to an installed t3 #25417

Closedt3dotgg(GitHub profile, opens in a new tab)wants to merge 4 commits intomain fromfeat/steer-off-npxopened View on GitHub

Showing 38 changed files with 128 additions and 6 deletions (loading 36).

x
0 of 38 viewed, 38 left
13 additions and 0 deletionsapps/desktop/src/app/DesktopApp.tsModified
View file
@@ -15,6 +15,7 @@
import * as DesktopAppActivation from "./DesktopAppActivation.ts";
import * as DesktopAppIdentity from "./DesktopAppIdentity.ts";
import * as DesktopClerk from "./DesktopClerk.ts";
+import * as DesktopCliCommand from "./DesktopCliCommand.ts";
import * as DesktopApplicationMenu from "../window/DesktopApplicationMenu.ts";
import * as DesktopWindow from "../window/DesktopWindow.ts";
import * as PreviewPasskeys from "../preview/Passkeys.ts";
@@ -186,6 +187,18 @@
​
yield* snapShot.initialize;
+ // A fresh install has no cached shell PATH yet; without it, another t3 on PATH goes unseen.
+ // If the login shell gives none, a later launch tries again.
+ const installCli = (yield* DesktopCliCommand.DesktopCliCommand).installOnFirstLaunch;
+ yield* Effect.forkScoped(
+ (yield* DesktopShellEnvironment.DesktopShellEnvironment).awaitDiscovery.pipe(
+ Effect.flatMap((found) =>
+ found || environment.platform === "win32"
+ ? installCli
+ : logBootstrapInfo("skipped installing the t3 command without the shell PATH"),
+ ),
+ ),
+ );
​
if (!settings.localEnvironmentEnabled) {
yield* logBootstrapInfo("bootstrap skipping local environment (disabled in settings)");