diff --git a/Data/git-repos.csv b/Data/git-repos.csv new file mode 100644 index 00000000..2339747f --- /dev/null +++ b/Data/git-repos.csv @@ -0,0 +1,22 @@ +AppName,FolderName,Branch,Shallow,URL +B256U, base256unicode, master, no, "https://github.com/fleschutz/base256unicode" +Bazel, bazel, master, yes, "https://github.com/bazelbuild/bazel" +CMake, cmake, master, yes, "https://github.com/Kitware/CMake" +CMatrix, cmatrix, master, yes, "https://github.com/abishekvashok/cmatrix" +CMark, cmark, master, yes, "https://github.com/commonmark/cmark" +CWTS, CWTS, master, no, "https://github.com/fleschutz/CWTS" +ElasticSearch, elasticsearch, master, yes, "https://github.com/elastic/elasticsearch" +Grafana, grafana, main, yes, "https://github.com/grafana/grafana" +LLVM, llvm, master, yes, "https://github.com/llvm/llvm-project" +Ninja, ninja, master, yes, "git://github.com/ninja-build/ninja.git" +OpenCV, opencv, master, yes, "https://github.com/opencv/opencv" +OSMA, OSMA, master, no, "https://github.com/fleschutz/OSMA" +PowerShell, PowerShell, master, no, "https://github.com/fleschutz/PowerShell" +LSS, LSS, master, yes, "https://github.com/fleschutz/LSS" +ProtoBuf, protobuf, master, yes, "https://github.com/protocolbuffers/protobuf" +SmartMonTools, smartmontools, master, yes, "https://github.com/smartmontools/smartmontools" +Tensorflow, tensorflow, master, yes, "https://github.com/tensorflow/tensorflow" +Windows Terminal,terminal, main, yes, "https://github.com/microsoft/terminal" +TinyCC, tinycc, mob, yes, "https://github.com/TinyCC/tinycc" +Voice2Json, voice2json, master, yes, "https://github.com/synesthesiam/voice2json" +ZFS, zfs, master, yes, "https://github.com/openzfs/zfs" diff --git a/Data/git-repositories.csv b/Data/git-repositories.csv deleted file mode 100644 index 0f310fcd..00000000 --- a/Data/git-repositories.csv +++ /dev/null @@ -1,22 +0,0 @@ -AppName,FolderName,BranchName,URL -B256U, base256unicode, master, "https://github.com/fleschutz/base256unicode" -Bazel, bazel, master, "https://github.com/bazelbuild/bazel" -CMake, cmake, master, "https://github.com/Kitware/CMake" -CMatrix, cmatrix, master, "https://github.com/abishekvashok/cmatrix" -CMark, cmark, master, "https://github.com/commonmark/cmark" -CWTS, CWTS, master, "https://github.com/fleschutz/CWTS" -ElasticSearch, elasticsearch, master, "https://github.com/elastic/elasticsearch" -Grafana, grafana, master, "https://github.com/grafana/grafana" -LLVM, llvm, master, "https://github.com/llvm/llvm-project" -Ninja, ninja, master, "git://github.com/ninja-build/ninja.git" -OpenCV, opencv, master, "https://github.com/opencv/opencv" -OSMA, OSMA, master, "https://github.com/fleschutz/OSMA" -PowerShell, PowerShell, master, "https://github.com/fleschutz/PowerShell" -LSS, LSS, master, "https://github.com/fleschutz/LSS" -ProtoBuf, protobuf, master, "https://github.com/protocolbuffers/protobuf" -SmartMonTools, smartmontools, master, "https://github.com/smartmontools/smartmontools" -Tensorflow, tensorflow, master, "https://github.com/tensorflow/tensorflow" -Windows Terminal,terminal, main, "https://github.com/microsoft/terminal" -TinyCC, tinycc, master, "https://github.com/TinyCC/tinycc" -Voice2Json, voice2json, master, "https://github.com/synesthesiam/voice2json" -ZFS, zfs, master, "https://github.com/openzfs/zfs" diff --git a/Scripts/clone-repos.ps1 b/Scripts/clone-repos.ps1 index ba4e10cd..11da2cbf 100755 --- a/Scripts/clone-repos.ps1 +++ b/Scripts/clone-repos.ps1 @@ -15,21 +15,27 @@ try { $Null = (git --version) if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" } - $Table = import-csv "$PSScriptRoot/../Data/git-repositories.csv" + $Table = import-csv "$PSScriptRoot/../Data/git-repos.csv" [int]$Count = 0 foreach($Row in $Table) { - $AppName = $Row.AppName - $FolderName = $Row.FolderName - $BranchName = $Row.BranchName - $URL = $Row.URL + [string]$AppName = $Row.AppName + [string]$FolderName = $Row.FolderName + [string]$Branch = $Row.Branch + [string]$Shallow = $Row.Shallow + [string]$URL = $Row.URL if (test-path "$ParentDir/$FolderName" -pathType container) { "📂$FolderName exists, skipping..." continue } - "🢃 Cloning $AppName into 📂$FolderName, $BranchName branch..." - & git clone --branch "$BranchName" --recurse-submodules "$URL" "$ParentDir/$FolderName" + if ($Shallow -eq "yes") { + "🢃 Cloning $AppName into 📂$FolderName, $Branch branch, shallow..." + & git clone --branch "$Branch" --depth 1 --shallow-submodules --recurse-submodules "$URL" "$ParentDir/$FolderName" + } else { + "🢃 Cloning $AppName into 📂$FolderName, $Branch branch, full history..." + & git clone --branch "$Branch" --recurse-submodules "$URL" "$ParentDir/$FolderName" + } if ($lastExitCode -ne "0") { throw "'git clone $URL' failed" } $Count++ }