Files
szci/ts/szci.classes.szcienv.ts
2025-12-13 13:27:51 +00:00

26 lines
753 B
TypeScript

import * as plugins from './szci.plugins.ts';
import { Szci } from './szci.classes.szci.ts';
export class SzciEnv {
public szciRef: Szci;
public repoString: string;
public repo: plugins.smartstring.GitRepo;
constructor(szciRefArg: Szci) {
this.szciRef = szciRefArg;
// Determine repo string from environment
let repoUrl: string | undefined;
if (Deno.env.get("GITLAB_CI")) {
repoUrl = Deno.env.get("CI_REPOSITORY_URL");
}
if (!repoUrl && Deno.env.get("SZCI_COMPUTED_REPOURL")) {
repoUrl = Deno.env.get("SZCI_COMPUTED_REPOURL");
}
this.repoString = repoUrl || 'https://undefined:undefined@github.com/undefined/undefined.git';
this.repo = new plugins.smartstring.GitRepo(this.repoString);
}
}