nork/src/setup.ts

25 lines
654 B
TypeScript
Raw Normal View History

2021-12-01 18:05:44 +01:00
import inquirer from 'inquirer'
import fs from 'fs-extra'
import path from 'path'
import Global from './global'
import { Questions } from './interfaces/SetupInterface'
export default class Setup {
static async setup(test = false) {
if (!test) {
const questions: Questions = {
type: 'list',
message: `Pick the technology you're using:`,
name: 'lang',
choices: [
{ name: 'Typescript', value: 'ts' },
{ name: 'Javascript', value: 'js' },
],
}
const answers = await inquirer.prompt(Object(questions))
fs.writeJsonSync(path.join(process.cwd(), './norkconfig.json'), answers)
}
return Global.logSuccess()
}
}