async function processConfiguration()

in packages/MSBot/src/msbot-create.ts [95:180]


async function processConfiguration(): Promise<void> {
    if ((<any>args)['proj-file']) {
        args.projFile = (<string>(<any>args)['proj-file']);
        console.log(args.projFile);
    }
    else if ((<any>args)['code-dir']) {
        args.codeDir = (<string>(<any>args)['code-dir']);
        console.log(args.codeDir);
    }

    let recipe = {
        "version": "1.0",
        "resources": [
            {
                "type": "endpoint",
                "id": "1",
                "name": "development",
                "url": "http://localhost:3978/api/messages"
            },
            {
                "type": "endpoint",
                "id": "2",
                "name": "production",
                "url": "https://your-bot-url.azurewebsites.net/api/messages"
            },
            {
                "type": "abs",
                "id": "3",
                "name": ""
            },
            {
                "type": "appInsights",
                "id": "4",
                "name": ""
            },
            {
                "type": "blob",
                "id": "5",
                "name": "",
                "container": "botstatestore"
            }
        ]
    };
    fs.writeFileSync("bot.recipe", JSON.stringify(recipe, null, 4), { encoding: 'utf8' });
    let command = `msbot clone services -f . --name ${args.name} -l ${args.location} `;
    if (args.groupName)
        command += ` --groupname ${args.groupName}`;

    if (args.codeDir)
        command += ` --code-dir ${args.codeDir}`;

    if (args.projFile)
        command += ` --proj-file ${args.projFile}`;

    if (args.verbose)
        command += ` --verbose`;

    if (args.quiet)
        command += ` --quiet`;

    if (args.force)
        command += ` --force`;

    if (args.appId)
        command += ` --appId ${args.appId}`;

    if (args.appSecret)
        command += ` --appSecret ${args.appSecret}`;

    if (args.subscriptionId)
        command += ` --subscriptionId ${args.subscriptionId}`;

    if (args.insightsRegion)
        command += ` --insightsRegion ${args.insightsRegion}`;

    if (args.groupName)
        command += ` --groupName ${args.groupName}`;

    if (args.sdkLanguage)
        command += ` --sdkLanguage ${args.sdkLanguage}`;

    if (args.searchSku)
        command += ` --searchSku ${args.searchSku}`;

    await spawnAsync(command, (out) => process.stdout.write(out.replace("clone services", "create")), (err) => { }/* process.stderr.write(err)*/);
};