mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2025-04-23 13:08:11 +00:00
remove chalk dep for cloudformation document generator
This commit is contained in:
parent
668a49c826
commit
040e0d3df7
2 changed files with 16 additions and 5 deletions
|
@ -12,13 +12,27 @@ import fs from 'fs';
|
||||||
import { fileURLToPath } from 'url';
|
import { fileURLToPath } from 'url';
|
||||||
import path, { dirname } from 'path';
|
import path, { dirname } from 'path';
|
||||||
import { exit } from 'process';
|
import { exit } from 'process';
|
||||||
import chalk from 'chalk';
|
|
||||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||||
const REPLACEMENT_KEY = '!SUB::USER::CONTENT!'
|
const REPLACEMENT_KEY = '!SUB::USER::CONTENT!'
|
||||||
|
|
||||||
const envPath = path.resolve(__dirname, `../../docker/.env`)
|
const envPath = path.resolve(__dirname, `../../docker/.env`)
|
||||||
const envFileExists = fs.existsSync(envPath);
|
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) {
|
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(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'))
|
console.log('You can start by running', chalk.cyan('cp -n ./docker/.env.example ./docker/.env'))
|
||||||
|
|
|
@ -18,8 +18,5 @@
|
||||||
"prod:frontend": "cd frontend && yarn build",
|
"prod:frontend": "cd frontend && yarn build",
|
||||||
"generate:cloudformation": "node aws/cloudformation/generate.mjs"
|
"generate:cloudformation": "node aws/cloudformation/generate.mjs"
|
||||||
},
|
},
|
||||||
"private": false,
|
"private": false
|
||||||
"devDependencies": {
|
|
||||||
"chalk": "^5.2.0"
|
|
||||||
}
|
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue