<commit_before>#!/usr/bin/env node
var path = require('path');
require("./process/console");
var configs = function () {
    var config = {};
    process.argv.slice(2).forEach(function (key, cx) {
        key = key.toLowerCase();
        config[key] = true;
    });
    return config;
}();

var setenv = function (evn) {
    Object.assign(process.env, evn);
};


var isTestMode = configs.test;
var isHelpMode = configs.help;
var isPublicMode = configs.build || configs.public || configs.release || configs.publish;
var isWatchMode = configs.watch;
var isServerMode = configs.server || configs.serve;
var isInitCommand = configs.init || configs.from;
var isDocsCommand = configs.doc || configs.docs;
var isDemoCommand = configs.demo || configs.zimoli;
var loadModule = process.argv.slice(2).filter(e => /[\/\\]|_test$|\.[tj]sx?$/i.test(e));
var isStartCommand = configs.start || configs.run;
var isRobber = configs.bug || configs.record || configs.robber;
var isLone = configs.lone || configs.live;
var isSettingPassword = configs.password;
var detectEnvironment = function () {
    let fs = require("fs");
    let currentpath = process.cwd(), config = {
        page_path: currentpath,
        comm: "./,zimoli",
        coms_path: '',
        app: './',
        page: './',
    };
    var env_path = [];
    return new Promise(function (ok) {
        fs.readdir(currentpath, function (error, names) {
            if (error) return console.error(error);
            var coms_path = [];
            var public_path = [];
            names.filter(function (name) {
                return fs.statSync(name).isDirectory();
            }).forEach(function (name) {
                if (/page/i.test(name)) {
                    config.page_path = name;
                } else if (/src|source/i.test(name)) {
                    config.page_path = name;
                    coms_path.push(name);
                } else if (/lib|com|fun|dep/i.test(name)) {
                    coms_path.push(name);
                } else if (/env|conf/i.test(name)) {
                    env_path.push(name);
                } else if (/d[ie]st|www|pub|release|^(?:out|output)$/i.test(name)) {
                    public_path.push(name);
                }
            });
            coms_path.push(':');
            config.coms_path = coms_path.join(',');
            var exists_envpath = (a, extt) => fs.existsSync(path.join(currentpath, a, 'setup' + extt));
            env_path = env_path.filter(a => exists_envpath(a, '.bat') || exists_envpath(a, '.cmd') || exists_envpath(a, '.sh'));
            if (public_path.length === 1) {
                config.public_path = public_path[0];
            }<commit_msg>添加一些中文名<commit_after>#!/usr/bin/env node
var path = require('path');
require("./process/console");
var configs = function () {
    var config = {};
    process.argv.slice(2).forEach(function (key, cx) {
        key = key.toLowerCase();
        config[key] = true;
    });
    return config;
}();

var setenv = function (evn) {
    Object.assign(process.env, evn);
};


var isTestMode = configs.test;
var isHelpMode = configs.help;
var isPublicMode = configs.build || configs.public || configs.release || configs.publish;
var isWatchMode = configs.watch;
var isServerMode = configs.server || configs.serve;
var isInitCommand = configs.init || configs.from;
var isDocsCommand = configs.doc || configs.docs;
var isDemoCommand = configs.demo || configs.zimoli;
var loadModule = process.argv.slice(2).filter(e => /[\/\\]|_test$|\.[tj]sx?$/i.test(e));
var isStartCommand = configs.start || configs.run;
var isRobber = configs.bug || configs.record || configs.robber;
var isLone = configs.lone || configs.live;
var isSettingPassword = configs.password;
var detectEnvironment = function () {
    let fs = require("fs");
    let currentpath = process.cwd(), config = {
        page_path: currentpath,
        comm: "./,zimoli",
        coms_path: '',
        app: './',
        page: './',
    };
    var env_path = [];
    return new Promise(function (ok) {
        fs.readdir(currentpath, function (error, names) {
            if (error) return console.error(error);
            var coms_path = [];
            var public_path = [];
            names.filter(function (name) {
                return fs.statSync(name).isDirectory();
            }).forEach(function (name) {
                if (/page|界面|页面|应用|系统/i.test(name)) {
                    // 高屋|瓴|楼|台|宫|阁|殿|庙|堂|会|场|司|衙|门|党|帮|派|族|山|庄|寺|教|家|城|店|军|队|团|师|营|苟
                    config.page_path = name;
                    rest.push(name);
                } else if (/src|source|code|源|代码/i.test(name)) {
                    config.page_path = name;
                    coms_path.push(name);
                } else if (/lib|com|fun|dep|组件|模块|依赖|库|函数/i.test(name)) {
                    // 卡木|设施|员|工|匠|子|弟|臣|下|客|器|械|备|库|房|土|基|石|砖
                    coms_path.push(name);
                } else if (/env|conf|环境|配置|设置/i.test(name)) {
                    env_path.push(name);
                } else if (/d[ie]st|www|pub|release|发布|目标|版本|输出|产品|^(?:out|output)$/i.test(name)) {
                    // 梦|思想|籍|书|法|规|外|景
                    public_path.push(name);
                }
            });
            coms_path.push(':');
            config.coms_path = coms_path.join(',');
            var exists_envpath = (a, extt) => fs.existsSync(path.join(currentpath, a, 'setup' + extt));
            env_path = env_path.filter(a => exists_envpath(a, '.bat') || exists_envpath(a, '.cmd') || exists_envpath(a, '.sh'));
            if (public_path.length === 1) {
                config.public_path = public_path[0];
            }
{'fraction_non_alphanumeric': 0.16531117397454032, 'fraction_numerical': 0.0014144271570014145, 'mean_word_length': 2.1906373378454598, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2900318', 'n_tokens_mistral': 1943, 'n_tokens_neox': 1934, 'n_words': 332}