summaryrefslogtreecommitdiffhomepage
path: root/services/repos/scripts/clone-repos.sh
blob: e4ea7ffc68b19210a5aeaf79ccb7faa42cba155e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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