diff options
Diffstat (limited to 'services/repos/scripts/clone-repos.sh')
| -rwxr-xr-x | services/repos/scripts/clone-repos.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/services/repos/scripts/clone-repos.sh b/services/repos/scripts/clone-repos.sh new file mode 100755 index 00000000..e4ea7ffc --- /dev/null +++ b/services/repos/scripts/clone-repos.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +set -euo pipefail + +for url in $(grep '^repo\.homepage=' repos.cgitrc | sed 's/^repo\.homepage=//'); do + repo_name=$(basename "$url" .git) + repo_path="repos/${repo_name}.git" + + if [[ -d "$repo_path" ]]; then + echo "Skipping $repo_name" + else + echo "Cloning $repo_name from $url" + git clone --bare "$url" "$repo_path" + sleep 5 + fi +done |
