diff --git a/src/commands/global.ts b/src/commands/global.ts index 7a4f12a4..b7fa6f3b 100644 --- a/src/commands/global.ts +++ b/src/commands/global.ts @@ -2720,20 +2720,19 @@ async function globalTrust(): Promise { return 1; } - if (isLinux()) { - await configureLinuxHostTlsTrust({ certPath }); - return 0; - } - - const trustReady = await ensureMacTrustCaddyLocalCa({ - certPath, - }); - if (trustReady) { - await configureMacHostTlsTrust({ + if (isMac()) { + const trustReady = await ensureMacTrustCaddyLocalCa({ certPath, }); + if (trustReady) { + await configureMacHostTlsTrust({ + certPath, + }); + } + return 0; } + await configureLinuxHostTlsTrust({ certPath }); return 0; } diff --git a/tests/global-command.macos.test.ts b/tests/global-command.macos.test.ts index 8627d681..5e1c07fa 100644 --- a/tests/global-command.macos.test.ts +++ b/tests/global-command.macos.test.ts @@ -204,6 +204,7 @@ const osMock = await registerScopedModuleMock({ specifier: "../src/lib/os.ts", overrides: { isMac: () => true, + isLinux: () => false, openUrl: async () => 0, }, });