import * as chalk from 'chalk'; import { existsSync } from 'fs'; import { join } from 'path'; import {getEnv} from './Config'; function printEnv(env: string) { switch (env) { case 'staging': return chalk.yellow(env); case 'production': return chalk.red(env); default: return chalk.gray(env); } } export function showEnvironment() { if (existsSync(join(__dirname, '../commands/env'))) { const env = getEnv(); console.log(chalk.gray(`Active environment: ${printEnv(env)}`)); } }