<commit_before>import * as fs from "fs-extra";
import * as path from "path";
import * as lib from "..";
import compileServer from "./compile/server";
import generateIndexes from "./generate/indexes";

export default async function execute(args: string[]): Promise<boolean> {
    console.log("Setting up fresh Eta instance...");
    await lib.exec("npm install");
    await generateIndexes([]);
    await compileServer([], false); // it'll throw unnecessary errors about db.ts, don't need to scare the user
    const configFiles: string[] = await lib.recursiveReaddir(lib.WORKING_DIR + "/config");
    await Promise.all(configFiles
        .filter(f => f.endsWith(".sample.json"))
        .map(f => fs.copy(f, f.replace(/\.sample\.json/g, ".json")))
    );<commit_msg>Don't overwrite new config files<commit_after>import * as fs from "fs-extra";
import * as path from "path";
import * as lib from "..";
import compileServer from "./compile/server";
import generateIndexes from "./generate/indexes";

export default async function execute(args: string[]): Promise<boolean> {
    console.log("Setting up fresh Eta instance...");
    await lib.exec("npm install");
    await generateIndexes([]);
    await compileServer([], false); // it'll throw unnecessary errors about db.ts, don't need to scare the user
    const configFiles: string[] = await lib.recursiveReaddir(lib.WORKING_DIR + "/config");
    await Promise.all(configFiles
        .filter(f => f.endsWith(".sample.json"))
        .map(f => fs.copy(f, f.replace(/\.sample\.json/g, ".json"), { overwrite: false }))
    );
{'fraction_non_alphanumeric': 0.1580952380952381, 'fraction_numerical': 0.0, 'mean_word_length': 3.8492307692307692, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6846355', 'n_tokens_mistral': 466, 'n_tokens_neox': 454, 'n_words': 142}