import colors from 'colors' export const errorMessage = (key) => { console.info(colors.red('\n\n ERROR: \n\n Environment variable not available. ')) console.info(colors.red(`\nMISSING KEY = ${key}`)) console.info(colors.red('\n\nTo fix:')) console.info(colors.red('\n\nGitLab: ')) console.info(colors.red('Add the key into the environment variables for the project')) console.info(colors.red('Make sure the variable is set to the correct environment')) console.info(colors.red('\n\nGitHub: ')) console.info(colors.red('Add the key into the environment variables for the project')) console.info(colors.red('Run this command with the prefix that is equal to the environment.')) console.info(colors.red('Example: PROD')) console.info(colors.red('.env.example >> DATABASE_URL="mysql://username:password@hostname:port/dbname"')) console.info(colors.red('CI/CD variable >> PROD_DATABASE_URL="mysql://waz:aaa@url:3306/prod"')) console.info(colors.red('Run: wappi envfile PROD')) console.info(colors.red('Result: DATABASE_URL="mysql://waz:aaa@url:3306/prod"')) console.info(colors.red('\n\nCircleCI: ')) console.info(colors.red('Add the key into the environment variables for the project')) console.info(colors.red('Run this command with the prefix that is equal to the environment.')) console.info(colors.red('Example: STAGE')) console.info(colors.red('.env.example >> DATABASE_URL="mysql://username:password@hostname:port/dbname"')) console.info(colors.red('CI/CD variable >> STAGE_DATABASE_URL="mysql://waz:aaa@url:3306/stage"')) console.info(colors.red('Run: wappi envfile STAGE')) console.info(colors.red('Result: DATABASE_URL="mysql://waz:aaa@url:3306/stage"')) } export const isBoolean = (value: string) => { switch (value) { case 'true': return true case 'false': return true default: return false } }