
import * as fs from 'fs-extra-promise';
import * as path from 'path';


const engineRoot = path.resolve(__dirname, '../../');

const egretProperties = `{
    "compilerVersion": "5.3.1",
    "engineVersion": "5.3.1",
    "modules": [
        {
            "name": "egret"
        },
        {
            "name":"eui"
        },
        {
            "name": "assetsmanager"
        }
    ]
}`;


export async function run(name: string, sub: string[], options: any) {
    const projectname = sub[0];
    if (!projectname) {
        throw 'no project name'
    }
    const templatesRoot = path.resolve(__dirname, '../templates');
    await fs.copyAsync(templatesRoot, projectname)
    await fs.writeFileAsync(path.join(projectname, 'egretProperties.json'), egretProperties, 'utf-8')
}
