PowerShell/Scripts/clone-repos.ps1

25 lines
860 B
PowerShell
Raw Normal View History

2020-12-01 12:24:56 +01:00
#!/snap/bin/powershell
# Syntax: ./clone-repos.ps1
2020-12-08 13:36:22 +01:00
# Description: clones well-known Git repositories into the current directory.
2020-12-01 12:24:56 +01:00
# Author: Markus Fleschutz
# Source: github.com/fleschutz/PowerShell
# License: CC0
2020-12-08 13:36:22 +01:00
$Repos = "https://github.com/commonmark/cmark", "https://github.com/opencv/opencv", "https://github.com/openzfs/zfs", "https://github.com/synesthesiam/voice2json", "https://github.com/fleschutz/CWTS", "https://github.com/fleschutz/cubesum", "https://github.com/fleschutz/PowerShell","https://github.com/fleschutz/CWTS", "https://github.com/fleschutz/eventdriven"
2020-12-01 12:24:56 +01:00
2020-12-09 10:30:55 +01:00
try {
foreach ($Repo in $Repos) {
$Answer = read-host "Do you want to clone $Repo (y/n)"
if ($Answer -eq "y") {
git clone $Repo
}
2020-12-01 12:24:56 +01:00
}
2020-12-25 11:30:43 +01:00
write-output "Done."
2020-12-09 10:30:55 +01:00
exit 0
} catch {
2020-12-25 11:30:43 +01:00
write-error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
2020-12-09 10:30:55 +01:00
exit 1
}