2022-11-29 16:10:19 -06:00
|
|
|
import { checkNodeVersion, getChoices, createEnvironment } from './utils.mjs'
|
2023-09-30 15:06:51 +02:00
|
|
|
import chalk from 'chalk'
|
|
|
|
|
|
|
|
const color = (hex, txt) => chalk.hex(hex).bold(txt)
|
|
|
|
const red = (txt) => color('#EF4444', txt)
|
|
|
|
const orange = (txt) => color('#F97316', txt)
|
|
|
|
const yellow = (txt) => color('#FACC15', txt)
|
|
|
|
const green = (txt) => color('#84CC16', txt)
|
|
|
|
const blue = (txt) => color('#3B82F61', txt)
|
|
|
|
const violet = (txt) => color('#8B5CF6', txt)
|
|
|
|
const tblue = (txt) => color('#77cbf9', txt)
|
|
|
|
const tpink = (txt) => color('#ecadb9', txt)
|
|
|
|
const white = (txt) => color('#ffffff', txt)
|
|
|
|
const text = (txt) => chalk.hex('#cccccc').dim(txt)
|
|
|
|
|
|
|
|
const nl = '\n'
|
|
|
|
|
|
|
|
const banner =
|
|
|
|
nl +
|
|
|
|
red(' ___ ') +
|
|
|
|
yellow(' ___') +
|
|
|
|
blue(' _') +
|
|
|
|
nl +
|
|
|
|
red(' | __| _') +
|
|
|
|
orange(' ___ ___') +
|
|
|
|
yellow('/ __|') +
|
|
|
|
green(' _____ _') +
|
|
|
|
blue('_ _(_)') +
|
|
|
|
violet('_ _ __ _') +
|
|
|
|
nl +
|
|
|
|
red(` | _| '_/`) +
|
|
|
|
orange(' -_) -_)') +
|
|
|
|
yellow('__ \\') +
|
|
|
|
green('/ -_) V ') +
|
|
|
|
blue(' V / |') +
|
|
|
|
violet(` ' \\/ _\` |`) +
|
|
|
|
nl +
|
|
|
|
red(` |_||_|`) +
|
|
|
|
orange(` \\___\\___`) +
|
|
|
|
yellow(`|___/`) +
|
|
|
|
green(`\\___|\\_/`) +
|
|
|
|
blue(`\\_/|_|`) +
|
|
|
|
violet(`_||_\\__, |`) +
|
|
|
|
nl +
|
|
|
|
text(` `) +
|
|
|
|
tblue('≡≡≡≡≡≡≡') +
|
|
|
|
tpink('≡≡≡≡≡≡≡') +
|
|
|
|
white('≡≡≡≡≡≡≡≡≡≡') +
|
|
|
|
tpink('≡≡≡≡≡≡≡') +
|
|
|
|
tblue('≡≡≡≡≡≡≡') +
|
|
|
|
violet(`|___/`) +
|
|
|
|
nl +
|
|
|
|
white(' Come') +
|
|
|
|
text(' for the ') +
|
|
|
|
white('sewing patterns') +
|
|
|
|
nl +
|
|
|
|
white(' Stay') +
|
|
|
|
text(' for the ') +
|
|
|
|
red('c') +
|
|
|
|
orange('o') +
|
|
|
|
yellow('m') +
|
|
|
|
green('m') +
|
|
|
|
blue('u') +
|
|
|
|
violet('n') +
|
|
|
|
white('i') +
|
|
|
|
tpink('t') +
|
|
|
|
tblue('y')
|
2022-06-20 18:31:22 +02:00
|
|
|
|
|
|
|
export const cli = async () => {
|
|
|
|
// Make it pretty
|
2022-12-30 16:38:55 +01:00
|
|
|
console.log(banner + '\n')
|
2022-06-20 18:31:22 +02:00
|
|
|
|
|
|
|
// Make sure we have a valid NodeJS version
|
|
|
|
checkNodeVersion()
|
|
|
|
|
|
|
|
// Get user input
|
|
|
|
const choices = await getChoices()
|
|
|
|
|
2023-09-29 09:47:54 +02:00
|
|
|
// Create environment
|
2022-07-12 20:09:17 +02:00
|
|
|
createEnvironment(choices)
|
2022-06-20 18:31:22 +02:00
|
|
|
}
|