2022-10-09 16:15:37 +00:00
|
|
|
import * as plugins from './npmci.plugins.js';
|
|
|
|
import { Npmci } from './npmci.classes.npmci.js';
|
2019-08-29 18:26:23 +00:00
|
|
|
|
|
|
|
export class NpmciEnv {
|
|
|
|
public npmciRef: Npmci;
|
|
|
|
|
|
|
|
public repoString: string;
|
|
|
|
public repo: plugins.smartstring.GitRepo;
|
|
|
|
|
|
|
|
constructor(npmciRefArg: Npmci) {
|
|
|
|
this.npmciRef = npmciRefArg;
|
2024-11-16 23:32:56 +00:00
|
|
|
if (!this.repoString && process.env.GITLAB_CI) {
|
2023-06-26 07:28:19 +00:00
|
|
|
this.repoString = process.env.CI_REPOSITORY_URL;
|
|
|
|
}
|
2024-11-16 23:32:56 +00:00
|
|
|
if (!this.repoString && process.env.NPMCI_COMPUTED_REPOURL) {
|
2023-06-26 07:28:19 +00:00
|
|
|
this.repoString = process.env.NPMCI_COMPUTED_REPOURL;
|
|
|
|
}
|
2019-08-29 18:26:23 +00:00
|
|
|
if (!this.repoString) {
|
|
|
|
this.repoString = 'https://undefined:undefined@github.com/undefined/undefined.git';
|
|
|
|
}
|
|
|
|
this.repo = new plugins.smartstring.GitRepo(this.repoString);
|
|
|
|
}
|
|
|
|
}
|