<commit_before>local fs = require 'bee.filesystem'
local sp = require 'bee.subprocess'
local platform = require 'bee.platform'
local inject = require 'inject'

local function u2a(s)
    if platform.OS == "Windows" then
        local unicode = require 'bee.unicode'
        return unicode.u2a(s)
    end
    return s
end

local function create_install_script(args, dbg, port)
    local utf8 = args.sourceCoding == "utf8"
    local res = {}
    if type(args.path) == "string" then
        res[#res+1] = ("package.path=[[%s]];"):format(utf8 and args.path or u2a(args.path))
    elseif type(args.path) == "table" then
        local path = {}
        for _, v in ipairs(args.path) do
            if type(v) == "string" then
                path[#path+1] = utf8 and v or u2a(v)
            end
            res[#res+1] = ("package.path=[[%s]];"):format(table.concat(path, ";"))
        end
    end
    if type(args.cpath) == "string" then
        res[#res+1] = ("package.cpath=[[%s]];"):format(utf8 and args.cpath or u2a(args.cpath))
    elseif type(args.cpath) == "table" then
        local path = {}
        for _, v in ipairs(args.cpath) do
            if type(v) == "string" then
                path[#path+1] = utf8 and v or u2a(v)
            end
            res[#res+1] = ("package.cpath=[[%s]];"):format(table.concat(path, ";"))
        end
    end

    res[#res+1] = ("local dbg=package.loadlib([[%s]], 'luaopen_debugger')();package.loaded[ [[%s]] ]=dbg;dbg:io([[pipe:%s]])"):format(
        utf8 and (dbg / "debugger.dll"):string() or u2a((dbg / "debugger.dll"):string()),<commit_msg>修正一个错误<commit_after>local fs = require 'bee.filesystem'
local sp = require 'bee.subprocess'
local platform = require 'bee.platform'
local inject = require 'inject'

local function u2a(s)
    if platform.OS == "Windows" then
        local unicode = require 'bee.unicode'
        return unicode.u2a(s)
    end
    return s
end

local function create_install_script(args, dbg, port)
    local utf8 = args.sourceCoding == "utf8"
    local res = {}
    if type(args.path) == "string" then
        res[#res+1] = ("package.path=[[%s]];"):format(utf8 and args.path or u2a(args.path))
    elseif type(args.path) == "table" then
        local path = {}
        for _, v in ipairs(args.path) do
            if type(v) == "string" then
                path[#path+1] = utf8 and v or u2a(v)
            end
        end
        res[#res+1] = ("package.path=[[%s]];"):format(table.concat(path, ";"))
    end
    if type(args.cpath) == "string" then
        res[#res+1] = ("package.cpath=[[%s]];"):format(utf8 and args.cpath or u2a(args.cpath))
    elseif type(args.cpath) == "table" then
        local path = {}
        for _, v in ipairs(args.cpath) do
            if type(v) == "string" then
                path[#path+1] = utf8 and v or u2a(v)
            end
        end
        res[#res+1] = ("package.cpath=[[%s]];"):format(table.concat(path, ";"))
    end

    res[#res+1] = ("local dbg=package.loadlib([[%s]], 'luaopen_debugger')();package.loaded[ [[%s]] ]=dbg;dbg:io([[pipe:%s]])"):format(
        utf8 and (dbg / "debugger.dll"):string() or u2a((dbg / "debugger.dll"):string()),
{'fraction_non_alphanumeric': 0.17790440012662234, 'fraction_numerical': 0.013295346628679962, 'mean_word_length': 2.678696158323632, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '229841', 'n_tokens_mistral': 1121, 'n_tokens_neox': 1119, 'n_words': 257}