外观
get_local_git_repos_list
约 164 字小于 1 分钟
2025-08-01
@candriajs/git-neko-kit / get_local_git_repos_list
函数: get_local_git_repos_list()
get_local_git_repos_list(
dirpath
,options
):Promise
<GitInfoListType
>
定义于: common/git.ts:131
获取本地仓库信息列表
参数
dirpath
string
options
GitRepoInfoListOptionsType
= ...
配置项
- loop 是否递归查找
- maxDepth 递归最大深度
- dir 忽略的文件夹名称列表
返回
Promise
<GitInfoListType
>
LocalGitInfoListType 仓库信息列表
示例
// 无数据
const res = await get_local_git_repo_list('D:\\project\\GitHub', { loop: true, maxDepth: 5, dir: ['node_modules'] })
-> {
total: 0,
items: []
}
// 有数据
const res = await get_local_git_repo_list('D:\\project\\GitHub', { loop: true, maxDepth: 5, dir: ['node_modules'] })
-> {
total: 1,
items: [{
name: "GitHub",
path: "D:\\project\\GitHub\\GitHub",
url: "https://github.com/GitHub/GitHub.git",
html_url: "https://github.com/GitHub/GitHub",
owner: "GitHub",
repo: "GitHub"
}]
}