remove chalk dep for cloudformation document generator

This commit is contained in:
timothycarambat 2023-06-14 11:02:46 -07:00
parent 668a49c826
commit 040e0d3df7
2 changed files with 16 additions and 5 deletions

View File

@ -12,13 +12,27 @@ import fs from 'fs';
import { fileURLToPath } from 'url';
import path, { dirname } from 'path';
import { exit } from 'process';
import chalk from 'chalk';
const __dirname = dirname(fileURLToPath(import.meta.url));
const REPLACEMENT_KEY = '!SUB::USER::CONTENT!'
const envPath = path.resolve(__dirname, `../../docker/.env`)
const envFileExists = fs.existsSync(envPath);
const chalk = {
redBright: function (text) {
return `\x1b[31m${text}\x1b[0m`
},
cyan: function (text) {
return `\x1b[36m${text}\x1b[0m`
},
greenBright: function (text) {
return `\x1b[32m${text}\x1b[0m`
},
blueBright: function (text) {
return `\x1b[34m${text}\x1b[0m`
}
}
if (!envFileExists) {
console.log(chalk.redBright('[ABORT]'), 'You do not have an .env file in your ./docker/ folder. You need to create it first.');
console.log('You can start by running', chalk.cyan('cp -n ./docker/.env.example ./docker/.env'))

View File

@ -18,8 +18,5 @@
"prod:frontend": "cd frontend && yarn build",
"generate:cloudformation": "node aws/cloudformation/generate.mjs"
},
"private": false,
"devDependencies": {
"chalk": "^5.2.0"
}
"private": false
}