Skip to content
Snippets Groups Projects
Commit 31f636f1 authored by michael.minelli's avatar michael.minelli
Browse files

Bug fix => Add missing config file

parent 7ea36ca6
No related branches found
No related tags found
No related merge requests found
Pipeline #25176 failed
import HttpManager from '../managers/HttpManager';
import getAppDataPath from 'appdata-path';
class Config {
private static _instance: Config;
private _apiURL!: string;
public gitlab: {
apiURL: string; dojoAccountId: number;
};
public readonly localConfig: {
folder: string; file: string;
};
private constructor() {
this.apiURL = process.env.API_URL || '';
this.gitlab = {
apiURL : process.env.GITLAB_API_URL || '',
dojoAccountId: Number(process.env.GITLAB_DOJO_ACCOUNT) || 0
};
this.localConfig = {
folder: getAppDataPath('DojoCLI'),
file : process.env.LOCAL_CONFIG_FILE || ''
};
}
get apiURL(): string {
return this._apiURL;
}
set apiURL(url: string) {
this._apiURL = url;
HttpManager.API_BASE_URL = this._apiURL;
}
public static get instance(): Config {
if ( !Config._instance ) {
Config._instance = new Config();
}
return Config._instance;
}
}
export default Config.instance;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment