@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 24 lines 729 Bytes
Raw
1 /**
2 * Shared config for the release scripts, read from env vars set by the
3 * release workflow.
4 *
5 * ALCHEMY_REPO `<owner>/<repo>` for changelog/release-note URLs
6 */
7 import * as Config from "effect/Config";
8 import * as Data from "effect/Data";
9 import * as Effect from "effect/Effect";
10
11 export class InvalidRepo extends Data.TaggedError("InvalidRepo")<{
12 readonly message: string;
13 }> {}
14
15 /** `ALCHEMY_REPO`, as `<owner>/<repo>`. */
16 export const repository = Effect.gen(function* () {
17 const repo = (yield* Config.String("ALCHEMY_REPO")).trim();
18 if (!/^[\w.-]+\/[\w.-]+$/.test(repo)) {
19 return yield* new InvalidRepo({
20 message: `ALCHEMY_REPO must be <owner>/<repo> (got: ${repo})`,
21 });
22 }
23 return repo;
24 });