prettier fix
This commit is contained in:
@@ -1,39 +1,39 @@
|
||||
const c = require("ansi-colors")
|
||||
const c = require('ansi-colors');
|
||||
|
||||
const requiredEnvs = [
|
||||
{
|
||||
key: "NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY",
|
||||
key: 'NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY',
|
||||
// TODO: we need a good doc to point this to
|
||||
description:
|
||||
"Learn how to create a publishable key: https://docs.medusajs.com/v2/resources/storefront-development/publishable-api-keys",
|
||||
'Learn how to create a publishable key: https://docs.medusajs.com/v2/resources/storefront-development/publishable-api-keys',
|
||||
},
|
||||
]
|
||||
];
|
||||
|
||||
function checkEnvVariables() {
|
||||
const missingEnvs = requiredEnvs.filter(function (env) {
|
||||
return !process.env[env.key]
|
||||
})
|
||||
return !process.env[env.key];
|
||||
});
|
||||
|
||||
if (missingEnvs.length > 0) {
|
||||
console.error(
|
||||
c.red.bold("\n🚫 Error: Missing required environment variables\n")
|
||||
)
|
||||
c.red.bold('\n🚫 Error: Missing required environment variables\n'),
|
||||
);
|
||||
|
||||
missingEnvs.forEach(function (env) {
|
||||
console.error(c.yellow(` ${c.bold(env.key)}`))
|
||||
console.error(c.yellow(` ${c.bold(env.key)}`));
|
||||
if (env.description) {
|
||||
console.error(c.dim(` ${env.description}\n`))
|
||||
console.error(c.dim(` ${env.description}\n`));
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
console.error(
|
||||
c.yellow(
|
||||
"\nPlease set these variables in your .env file or environment before starting the application.\n"
|
||||
)
|
||||
)
|
||||
'\nPlease set these variables in your .env file or environment before starting the application.\n',
|
||||
),
|
||||
);
|
||||
|
||||
process.exit(1)
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = checkEnvVariables
|
||||
module.exports = checkEnvVariables;
|
||||
|
||||
Reference in New Issue
Block a user