import simpleGit from 'simple-git/promise'; import { Weshop } from '../../typings/index'; interface ClonePackagesOpts { noDepth?: boolean; noSparseCheckout?: boolean; } /** * 根据 Packages 拉取包 * 若包已存在,则选择 git fetch,否则 git clone * 所有的包的拉取深度都仅为 1 * 内部做了并发限制处理,TODO 并发限制做可配置 * @param packages Repo[] * @param basePath 仓库存放路径 * @param packages 拉取仓库地址 * @param options 拉取配置 * @param logs 日志数组 */ export declare function clonePackages(basePath: string, packages: Weshop.Repo[], options?: ClonePackagesOpts, logs?: Weshop.Log[]): Promise; /** * 若是普通包,则正常合并 * 若是依赖包,则使用稀疏拉取 * @param git SimpleGit 实例 * @param repo 仓库信息 * @param packageDir 克隆目标地址 * @param options 配置 */ export declare function clonePackagesOrDependencies(git: simpleGit.SimpleGit, repo: Weshop.Repo, packageDir: string, options?: ClonePackagesOpts): Promise; /** * 用于处理克隆深度为 1 时,无法正常更新分支 * @param branch 分支名 */ export declare function checkoutAndPullBranch(git: simpleGit.SimpleGit, baseDir: string, branch: string, options?: ClonePackagesOpts): Promise; export declare function rewriteGitIgnore(projectPath: string, filePathArr: string | string[]): Promise; /** * TODO 补充 HookName * 可执行的 githook * @param cwd * @param hookName * @param fileContent */ declare type HookName = 'pre-commit' | 'pre-push'; export declare function rewriteGitHooks(cwd: string, hookName: HookName, fileContent: string): Promise; export {}; //# sourceMappingURL=git.d.ts.map