Select Git revision
Forked from
Dojo Project (HES-SO) / Projects / UI / DojoCLI
129 commits behind the upstream repository.

michael.minelli authored
Config.ts 1.80 KiB
import getAppDataPath from 'appdata-path';
class Config {
public readonly localConfig: {
folder: string; sessionFile: string; stateFile: string;
};
public readonly versionUpdateInformationPeriodHours: number;
public readonly gitlab: {
cliReleasePage: string
};
public readonly login: {
server: {
port: number, route: string
}, gitlab: {
url: {
code: string
}
}
};
public readonly folders: {
defaultLocalExercise: string
};
public readonly exercise: {
neededFiles: Array<string>
};
public interactiveMode: boolean;
constructor() {
this.localConfig = {
folder : getAppDataPath('DojoCLI'),
sessionFile: process.env.LOCAL_CONFIG_FILE_SESSION || '',
stateFile : process.env.LOCAL_CONFIG_STATE || ''
};
this.versionUpdateInformationPeriodHours = Number(process.env.VERSION_UPDATE_INFORMATION_PERIOD_HOURS || 24);
this.gitlab = {
cliReleasePage: process.env.GITLAB_CLI_RELEASE_PAGE || ''
};
this.login = {
server: {
port : Number(process.env.LOGIN_SERVER_PORT || 30992),
route: process.env.LOGIN_SERVER_ROUTE || ''
},
gitlab: {
url: {
code: process.env.LOGIN_GITLAB_URL_CODE || ''
}
}
};
this.folders = {
defaultLocalExercise: process.env.LOCAL_EXERCISE_DEFAULT_FOLDER || './'
};
this.exercise = {
neededFiles: JSON.parse(process.env.EXERCISE_NEEDED_FILES || '[]')
};
this.interactiveMode = process.env.INTERACTIVE_MODE === 'true';
}
}
export default new Config();