()
| 3239 | }; |
| 3240 | |
| 3241 | const openRunningLocalWebApp = (): Effect.Effect< |
| 3242 | void, |
| 3243 | never, |
| 3244 | FileSystem.FileSystem | PlatformPath.Path |
| 3245 | > => |
| 3246 | Effect.gen(function* () { |
| 3247 | const manifest = yield* readActiveLocalServerManifest().pipe(Effect.orElseSucceed(() => null)); |
| 3248 | if (!manifest) { |
| 3249 | printNoRunningLocalWebApp(); |
| 3250 | return; |
| 3251 | } |
| 3252 | const { origin, auth } = manifest.connection; |
| 3253 | const token = auth?.kind === "bearer" ? auth.token : undefined; |
| 3254 | const url = token ? `${origin}/?_token=${token}` : origin; |
| 3255 | console.log(`Opening ${url}`); |
| 3256 | yield* openInBrowser(url); |
| 3257 | }); |
| 3258 | |
| 3259 | /** |
| 3260 | * `executor open` — the friendly way back in. Reads the running local server's |
no test coverage detected