diff options
Diffstat (limited to 'clone-repos')
-rwxr-xr-x | clone-repos | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/clone-repos b/clone-repos new file mode 100755 index 0000000..6991380 --- /dev/null +++ b/clone-repos @@ -0,0 +1,22 @@ +#!/bin/sh + +base_dir=$(dirname "$(readlink -f "$0")") + +if [ ! -s "${base_dir}/work/wish-list" ]; then + exit +fi + +while read -r source_base64; do + if [ -d "${base_dir}/work/repositories/${source_base64}" ]; then + continue + fi + source=$( + printf '%s' "${source_base64}" | \ + base64 -d + ) + git -C "${base_dir}/work/repositories" clone --mirror "${source}" "${source_base64}" +done < \ + "${base_dir}/work/wish-list" + +grep -vxF "$(ls "${base_dir}/work/repositories")" "${base_dir}/work/wish-list" | \ + sponge "${base_dir}/work/wish-list" |