()
| 3286 | }; |
| 3287 | |
| 3288 | const openRunningLocalWebApp = (): Effect.Effect< |
| 3289 | void, |
| 3290 | never, |
| 3291 | FileSystem.FileSystem | PlatformPath.Path |
| 3292 | > => |
| 3293 | Effect.gen(function* () { |
| 3294 | const manifest = yield* readActiveLocalServerManifest().pipe(Effect.orElseSucceed(() => null)); |
| 3295 | if (!manifest) { |
| 3296 | printNoRunningLocalWebApp(); |
| 3297 | return; |
| 3298 | } |
| 3299 | const { origin, auth } = manifest.connection; |
| 3300 | const token = auth?.kind === "bearer" ? auth.token : undefined; |
| 3301 | const url = token ? `${origin}/?_token=${token}` : origin; |
| 3302 | console.log(`Opening ${url}`); |
| 3303 | yield* openInBrowser(url); |
| 3304 | }); |
| 3305 | |
| 3306 | /** |
| 3307 | * `executor open` — the friendly way back in. Reads the running local server's |
no test coverage detected