Skip to content

Commit bba62af

Browse files
committed
2 parents 78a8350 + 7eccb7b commit bba62af

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

downGithub.ps1

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ if (-not (Test-Path $repoParentPath)) {
129129
New-Item -ItemType Directory -Force -Path $repoParentPath
130130
}
131131
function updateRepo {
132-
params(
132+
param(
133133
[string]$Path
134134
)
135135
# 检查是否为 Git 仓库
@@ -155,11 +155,20 @@ function updateRepo {
155155
# }
156156
}
157157

158+
$totalRepos = $finalRepos.Count
159+
$currentRepo = 0
160+
158161
foreach ($repo in $finalRepos) {
162+
$currentRepo++
159163
$repoName = $repo.name
160164
$repoUrl = $repo.clone_url
161165
$repoPath = "$repoParentPath\$repoName"
162166

167+
# 显示进度
168+
Write-Progress -Activity "正在处理仓库" -Status "$currentRepo/$totalRepos - $repoName" `
169+
-PercentComplete (($currentRepo / $totalRepos) * 100) `
170+
-CurrentOperation "正在下载/更新仓库"
171+
163172
# 检查是否已经存在该目录
164173
if (-not (Test-Path -Path $repoPath)) {
165174
gh repo clone $repoUrl $repoPath
@@ -171,5 +180,8 @@ foreach ($repo in $finalRepos) {
171180
}
172181
}
173182

183+
# 完成后清除进度条
184+
Write-Progress -Activity "完成" -Completed
185+
174186

175187

0 commit comments

Comments
 (0)