mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 07:48:37 +01:00
refactoring dashboard
This commit is contained in:
8
shared_global/utils/requireEnv.ts
Normal file
8
shared_global/utils/requireEnv.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
export function requireEnv(name: string, errorMessage?: string) {
|
||||
if (!process.env[name]) {
|
||||
console.error(errorMessage || `ENV variable ${name} is required`);
|
||||
return process.exit(1);
|
||||
}
|
||||
return process.env[name] as string;
|
||||
}
|
||||
Reference in New Issue
Block a user