angular-cn/aio/aio-builds-setup/dockerbuild/scripts-js/lib/common/utils.ts

12 lines
282 B
TypeScript
Raw Normal View History

// Functions
export const getEnvVar = (name: string, isOptional = false): string => {
const value = process.env[name];
if (!isOptional && !value) {
console.error(`ERROR: Missing required environment variable '${name}'!`);
process.exit(1);
}
return value || '';
};