import {Command, command, metadata, param} from 'clime';
import Repo from "../../lib/repo";
import * as inquirer from "inquirer";
import asArray = Rx.helpers.asArray;
import {Questions} from "inquirer";

@command({
    description: 'Initialize model nest',
})
export default class extends Command {
    @metadata
    async execute() {
        const repo = new Repo(process.cwd());
        var prompt = inquirer.createPromptModule();
        const answer = await prompt({
            name: 'defaultWorkspace',
            message: 'Set your default workspace',
            default: '.'
        });
        // @ts-ignore
        const workspacePath : string = answer['defaultWorkspace'];
        repo.init();
        repo.createWorkspace('default', workspacePath);
    }
}
