mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-23 00:13:36 +01:00
Update clone-repos.ps1
This commit is contained in:
parent
f1fe5db242
commit
a4674ed7bb
@ -1,29 +1,29 @@
|
||||
GROUP, FOLDERNAME, BRANCH, FULL, URL
|
||||
Dev, base256unicode, main, no, "git@github.com:fleschutz/base256unicode.git"
|
||||
Dev, bazel, master, no, "git@github.com:bazelbuild/bazel.git"
|
||||
Dev, cmake, master, no, "git@github.com:Kitware/CMake.git"
|
||||
Fun, cmatrix, master, no, "git@github.com:abishekvashok/cmatrix.git"
|
||||
Tool, cmark, master, no, "git@github.com:commonmark/cmark.git"
|
||||
Dev, CWTS, master, no, "git@github.com:fleschutz/CWTS.git"
|
||||
Math, CSS, main, no, "git@github.com:chikitpao/CSS.git"
|
||||
Tool, elasticsearch, main, no, "git@github.com:elastic/elasticsearch.git"
|
||||
Tool, go-ipfs, master, no, "git@github.com:ipfs/go-ipfs.git"
|
||||
Tool, grafana, main, no, "git@github.com:grafana/grafana.git"
|
||||
Tool, jhead, master, no, "git@github.com:Matthias-Wandel/jhead"
|
||||
Tool, leon, master, no, "git@github.com:leon-ai/leon.git"
|
||||
Dev, llvm, master, no, "git@github.com:llvm/llvm-project.git"
|
||||
Math, LSS, master, no, "git@github.com:fleschutz/LSS.git"
|
||||
Dev, ninja, master, no, "git@github.com:ninja-build/ninja.git"
|
||||
Libs, opencv, master, no, "git@github.com:opencv/opencv.git"
|
||||
Tool, operating-systems, main, no, "git@github.com:fleschutz/operating-systems.git"
|
||||
Shell, PowerShell, master, no, "git@github.com:fleschutz/PowerShell.git"
|
||||
Shell, pwsh, master, no, "git@github.com:PowerShell/PowerShell.git"
|
||||
Dev, protobuf, main, no, "git@github.com:protocolbuffers/protobuf.git"
|
||||
Dev, rust, master, no, "git@github.com:rust-lang/rust.git"
|
||||
Tool, smartmontools, master, no, "git@github.com:smartmontools/smartmontools.git"
|
||||
Tool, talk2windows, main, no, "git@github.com:fleschutz/talk2windows.git"
|
||||
Tool, tensorflow, master, no, "git@github.com:tensorflow/tensorflow.git"
|
||||
Tool, terminal, main, no, "git@github.com:microsoft/terminal.git"
|
||||
Dev, tinycc, mob, no, "git@github.com:TinyCC/tinycc.git"
|
||||
Tool, voice2json, master, no, "git@github.com:synesthesiam/voice2json.git"
|
||||
Tool, zfs, master, no, "git@github.com:openzfs/zfs.git"
|
||||
FOLDERNAME, CATEGORY, BRANCH, FULL, URL
|
||||
base256unicode, dev tool, main, no, "git@github.com:fleschutz/base256unicode.git"
|
||||
bazel, build tool, master, no, "git@github.com:bazelbuild/bazel.git"
|
||||
cmake, build tool, master, no, "git@github.com:Kitware/CMake.git"
|
||||
cmatrix, CLI fun, master, no, "git@github.com:abishekvashok/cmatrix.git"
|
||||
cmark, tool, master, no, "git@github.com:commonmark/cmark.git"
|
||||
CWTS, dev tool, master, no, "git@github.com:fleschutz/CWTS.git"
|
||||
CSS, math tool, main, no, "git@github.com:chikitpao/CSS.git"
|
||||
elasticsearch, search tool, main, no, "git@github.com:elastic/elasticsearch.git"
|
||||
go-ipfs, tool, master, no, "git@github.com:ipfs/go-ipfs.git"
|
||||
grafana, visualization, main, no, "git@github.com:grafana/grafana.git"
|
||||
jhead, EXIF tool, master, no, "git@github.com:Matthias-Wandel/jhead"
|
||||
leon, personal assistant, master, no, "git@github.com:leon-ai/leon.git"
|
||||
llvm, compiler, master, no, "git@github.com:llvm/llvm-project.git"
|
||||
LSS, math, master, no, "git@github.com:fleschutz/LSS.git"
|
||||
ninja, build tool, master, no, "git@github.com:ninja-build/ninja.git"
|
||||
opencv, lib, master, no, "git@github.com:opencv/opencv.git"
|
||||
operating-systems, collection, main, no, "git@github.com:fleschutz/operating-systems.git"
|
||||
PowerShell, collection, master, no, "git@github.com:fleschutz/PowerShell.git"
|
||||
pwsh, shell, master, no, "git@github.com:PowerShell/PowerShell.git"
|
||||
protobuf, dev, main, no, "git@github.com:protocolbuffers/protobuf.git"
|
||||
rust, compiler, master, no, "git@github.com:rust-lang/rust.git"
|
||||
smartmontools, SSD/HDD tool, master, no, "git@github.com:smartmontools/smartmontools.git"
|
||||
talk2windows, tool, main, no, "git@github.com:fleschutz/talk2windows.git"
|
||||
tensorflow, tool, master, no, "git@github.com:tensorflow/tensorflow.git"
|
||||
terminal, desktop tool, main, no, "git@github.com:microsoft/terminal.git"
|
||||
tinycc, compiler, mob, no, "git@github.com:TinyCC/tinycc.git"
|
||||
voice2json, tool, master, no, "git@github.com:synesthesiam/voice2json.git"
|
||||
zfs, tool, master, no, "git@github.com:openzfs/zfs.git"
|
||||
|
|
@ -4,7 +4,7 @@
|
||||
.DESCRIPTION
|
||||
This PowerShell script clones popular Git repositories into a target directory.
|
||||
.PARAMETER targetDir
|
||||
Specifies the target directory (current working directory by default)
|
||||
Specifies the file path to the target directory (current working directory by default)
|
||||
.EXAMPLE
|
||||
PS> ./clone-repos C:\Repos
|
||||
.LINK
|
||||
@ -31,40 +31,35 @@ try {
|
||||
Write-Host "⏳ (3) Checking target folder... 📂$TargetDirName"
|
||||
if (-not(Test-Path "$TargetDir" -pathType container)) { throw "Can't access directory: $TargetDir" }
|
||||
|
||||
|
||||
[int]$Step = 3
|
||||
[int]$Cloned = 0
|
||||
[int]$Skipped = 0
|
||||
foreach($Row in $Table) {
|
||||
[string]$Group = $Row.GROUP
|
||||
[string]$FolderName = $Row.FOLDERNAME
|
||||
[string]$Category = $Row.CATEGORY
|
||||
[string]$Branch = $Row.BRANCH
|
||||
[string]$Full = $Row.FULL
|
||||
[string]$URL = $Row.URL
|
||||
$Step++
|
||||
|
||||
if (Test-Path "$TargetDir/$FolderName" -pathType container) {
|
||||
"⏳ ($Step/$($NumEntries + 4)) Skipping existing 📂$($FolderName)..."
|
||||
"⏳ ($Step/$($NumEntries + 4)) Skipping existing 📂$FolderName ($Category)..."
|
||||
$Skipped++
|
||||
continue
|
||||
}
|
||||
if ($Full -eq "yes") {
|
||||
"⏳ ($Step/$($NumEntries + 4)) Cloning into 📂$FolderName ($Branch branch with full history)..."
|
||||
"⏳ ($Step/$($NumEntries + 4)) Cloning into 📂$FolderName ($Category) - $Branch branch with full history..."
|
||||
& git clone --branch "$Branch" --recurse-submodules "$URL" "$TargetDir/$FolderName"
|
||||
if ($lastExitCode -ne "0") { throw "'git clone --branch $Branch $URL' failed with exit code $lastExitCode" }
|
||||
} else {
|
||||
"⏳ ($Step/$($NumEntries + 4)) Cloning into 📂$FolderName ($Branch branch only)..."
|
||||
"⏳ ($Step/$($NumEntries + 4)) Cloning into 📂$FolderName ($Category) - $Branch branch only..."
|
||||
& git clone --branch "$Branch" --single-branch --recurse-submodules "$URL" "$TargetDir/$FolderName"
|
||||
if ($lastExitCode -ne "0") { throw "'git clone --branch $Branch $URL' failed with exit code $lastExitCode" }
|
||||
}
|
||||
$Cloned++
|
||||
}
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
if ($Cloned -eq 1) {
|
||||
"✔️ 1 repo cloned into 📂$TargetDirName in $Elapsed sec ($Skipped skipped)"
|
||||
} else {
|
||||
"✔️ $Cloned repos cloned into 📂$TargetDirName in $Elapsed sec ($Skipped skipped)"
|
||||
}
|
||||
"✔️ cloned $Cloned of $NumEntries Git repos into folder 📂$TargetDirName in $Elapsed sec"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
Loading…
Reference in New Issue
Block a user