This commit is contained in:
17
scripts/validate-env.ts
Normal file
17
scripts/validate-env.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { envSchema, getRawEnv } from '../lib/env';
|
||||
|
||||
/**
|
||||
* Simple script to validate environment variables.
|
||||
* If validation fails, this script will exit with code 1.
|
||||
*/
|
||||
try {
|
||||
const env = envSchema.parse(getRawEnv());
|
||||
console.log('✅ Environment variables validated successfully.');
|
||||
console.log('Base URL:', env.NEXT_PUBLIC_BASE_URL);
|
||||
} catch (error) {
|
||||
console.error('❌ Environment validation failed.');
|
||||
if (error instanceof Error) {
|
||||
console.error(error.message);
|
||||
}
|
||||
process.exit(1);
|
||||
}
|
||||
Reference in New Issue
Block a user