Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): keep provider CLIs available in the macOS service #8173

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

Showing 2 changed files with 96 additions and 24 deletions (loading 1).

x
0 of 2 viewed, 2 left
96 additions and 24 deletionsapps/server/src/cloud/bootService.test.tsModified
View file
@@ -56,17 +56,26 @@
logPath: "/Users/theo/.t3/userdata/logs/boot-service.log",
unitPath: "/Users/theo/Library/LaunchAgents/com.t3tools.t3code.service.plist",
};
+const macInstallerPath =
+ "/opt/homebrew/bin:/Users/theo/.npm-global/bin:/Users/theo/.nvm/versions/node/v22.16.0/bin:/usr/bin:/bin";
+const macRenderOptions = { homeDir: "/Users/theo", environmentPath: macInstallerPath };
​
it("keeps launchd pinned to the stable launcher rather than a versioned server", () => {
- const plist = BootService.renderBootServicePlist(macPlan, { homeDir: "/Users/theo" });
+ const plist = BootService.renderBootServicePlist(macPlan, macRenderOptions);
​
expect(plist).toContain("<string>/opt/homebrew/bin/node</string>");
expect(plist).toContain("<string>/Users/theo/.t3/runtime/service-launcher.mjs</string>");
expect(plist).not.toContain("versions/1.2.3");
});
​
+it("preserves the installer's provider search path in the launch agent", () => {
+ const plist = BootService.renderBootServicePlist(macPlan, macRenderOptions);
+​
+ expect(plist).toContain(` <key>PATH</key>\n <string>${macInstallerPath}</string>`);
+});
+​
it("restarts the launch agent on the systemd cadence", () => {
- const plist = BootService.renderBootServicePlist(macPlan, { homeDir: "/Users/theo" });
+ const plist = BootService.renderBootServicePlist(macPlan, macRenderOptions);
​
expect(plist).toContain("<key>RunAtLoad</key>\n <true/>");
expect(plist).toContain("<key>KeepAlive</key>\n <true/>");