mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-14 09:33:09 +02:00
21 lines
585 B
TypeScript
21 lines
585 B
TypeScript
|
const envOption = {
|
||
|
onlyQueue: false,
|
||
|
onlyServer: false,
|
||
|
noDaemons: false,
|
||
|
disableClustering: false,
|
||
|
verbose: false,
|
||
|
withLogTime: false,
|
||
|
quiet: false,
|
||
|
slow: false,
|
||
|
};
|
||
|
|
||
|
for (const key of Object.keys(envOption) as (keyof typeof envOption)[]) {
|
||
|
if (process.env['MK_' + key.replace(/[A-Z]/g, letter => `_${letter}`).toUpperCase()]) envOption[key] = true;
|
||
|
}
|
||
|
|
||
|
if (process.env.NODE_ENV === 'test') envOption.disableClustering = true;
|
||
|
if (process.env.NODE_ENV === 'test') envOption.quiet = true;
|
||
|
if (process.env.NODE_ENV === 'test') envOption.noDaemons = true;
|
||
|
|
||
|
export { envOption };
|