diff options
Diffstat (limited to 'clone-repos')
-rwxr-xr-x | clone-repos | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/clone-repos b/clone-repos index 6991380..89dcb24 100755 --- a/clone-repos +++ b/clone-repos @@ -6,7 +6,7 @@ if [ ! -s "${base_dir}/work/wish-list" ]; then exit fi -while read -r source_base64; do +while read -r type source_base64; do if [ -d "${base_dir}/work/repositories/${source_base64}" ]; then continue fi @@ -14,9 +14,20 @@ while read -r source_base64; do printf '%s' "${source_base64}" | \ base64 -d ) - git -C "${base_dir}/work/repositories" clone --mirror "${source}" "${source_base64}" + case "${type}" in + 'git') + git -C "${base_dir}/work/repositories" clone --mirror "${source}" "${source_base64}" + ;; + *) + >&2 printf 'unknown type "%s"\n' \ + "${type}" + ;; + ) done < \ "${base_dir}/work/wish-list" -grep -vxF "$(ls "${base_dir}/work/repositories")" "${base_dir}/work/wish-list" | \ +grep -vxF "$( + find "${base_dir}/work/repositories" -mindepth 2 -maxdepth 2 | \ + sed 's,^.*/\([^/]\+\)/\([^/]\+\)$,\1 \2,' +)" "${base_dir}/work/wish-list" | \ sponge "${base_dir}/work/wish-list" |