diff options
author | Erich Eckner <git@eckner.net> | 2018-09-28 14:12:06 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-09-28 14:12:06 +0200 |
commit | ae5d9e45f7de537c22e6e4e36524ef15b739007b (patch) | |
tree | 4160b5807b0d752931a16173c6357b3023355271 /clone-repos | |
parent | 9f5ca8045d6f9a2aae538f124c20038a833c94db (diff) | |
download | archive-server-ae5d9e45f7de537c22e6e4e36524ef15b739007b.tar.xz |
clone-repos new
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" |