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' },
|
2022-07-30 22:44:24 +02:00
|
|
|
{ name: 'Javascript', value: 'js' }
|
|
|
|
]
|
2021-12-01 18:05:44 +01:00
|
|
|
}
|
|
|
|
const answers = await inquirer.prompt(Object(questions))
|
|
|
|
fs.writeJsonSync(path.join(process.cwd(), './norkconfig.json'), answers)
|
|
|
|
}
|
|
|
|
return Global.logSuccess()
|
|
|
|
}
|
|
|
|
}
|