- MCP
- blame on this site's /mcp
- CLI
- abso blame client/src/env-names.ts --json
- JSON
- /christopher/abso-core/blame/client/src/env-names.ts?format=json
18 linesreview 100%Last change review in version 27,
18 lines from 1 change in 1 version.
review27Client: ABSO_ environment names (AVCS_ still read), .absoignore (.avcsignore still read), .abso-export.json, shot files; READMEs say abso (abso 224)Compare1// Environment names: ABSO_<NAME>, or the older AVCS_<NAME> from before the rename.
2// Read the new one first; where abso sets one for a program it runs, it sets both.
4export type EnvMap = Readonly<Record<string, string | undefined>>;
6/** ABSO_<name> if set (and not empty), else AVCS_<name>. */
7export function fromEnv(env: EnvMap, name: string): string | undefined {
8 return env[`ABSO_${name}`] || env[`AVCS_${name}`] || undefined;
9}
11/** Each ABSO_ entry once more under its AVCS_ name, for programs written before the rename. */
12export function withOldNames<T extends Record<string, string | undefined>>(
13 vars: T,
14): Record<string, string | undefined> {
15 const out: Record<string, string | undefined> = { ...vars };
16 for (const [k, v] of Object.entries(vars)) if (k.startsWith("ABSO_")) out[`AVCS_${k.slice(5)}`] = v;
17 return out;
18}