2025-10-26 15:23:56 +00:00
|
|
|
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;
|
2025-12-13 13:27:51 +00:00
|
|
|
|
|
|
|
|
// Determine repo string from environment
|
|
|
|
|
let repoUrl: string | undefined;
|
|
|
|
|
if (Deno.env.get("GITLAB_CI")) {
|
|
|
|
|
repoUrl = Deno.env.get("CI_REPOSITORY_URL");
|
2025-10-26 15:23:56 +00:00
|
|
|
}
|
2025-12-13 13:27:51 +00:00
|
|
|
if (!repoUrl && Deno.env.get("SZCI_COMPUTED_REPOURL")) {
|
|
|
|
|
repoUrl = Deno.env.get("SZCI_COMPUTED_REPOURL");
|
2025-10-26 15:23:56 +00:00
|
|
|
}
|
2025-12-13 13:27:51 +00:00
|
|
|
|
|
|
|
|
this.repoString = repoUrl || 'https://undefined:undefined@github.com/undefined/undefined.git';
|
2025-10-26 15:23:56 +00:00
|
|
|
this.repo = new plugins.smartstring.GitRepo(this.repoString);
|
|
|
|
|
}
|
|
|
|
|
}
|