import { accessSync, mkdirSync } from 'fs' import chalk from 'chalk'; import * as figlet from 'figlet' import { prompt as ask } from 'inquirer' import { allTemplates, extractTemplate } from '../init/starterTemplates' import { Template } from '../init/templateMetadata' import { logError, logInfo } from '../utils' /** * Check if directory exists * @param path path of the directory * @param name name of the project folder */ function checkDirectory(path: string, name: string): void { try { accessSync(path) logError(`A folder with name ${name} exists. Remove it or try another name.`) process.exit(0) } catch (error) { return } } /** * choose a template from available templates */ async function chooseTemplate(): Promise