()
| 8 | const log = (message: string) => console.log(chalk.green(message)) |
| 9 | |
| 10 | const getEnvInfo = () => { |
| 11 | // Gets the environment from the command line arguments if set, otherwise defaults to dev |
| 12 | const env = process.argv.find((arg) => ENVIRONMENTS.includes(arg)) ?? "" |
| 13 | // Sets the environment name to be console logged for info |
| 14 | const envName = env !== "" ? env : "dev" |
| 15 | // Allows for reading from .env .env.prod .env.stage etc |
| 16 | const path = `.env${env ? `.${env}` : ""}` |
| 17 | return { env, envName, path } |
| 18 | } |
| 19 | |
| 20 | const setupEnv = () => { |
| 21 | const { envName, path } = getEnvInfo() |
no outgoing calls
no test coverage detected
searching dependent graphs…