executable_mjru-git-clone.sh 458 B

12345678910111213141516171819
  1. #!/bin/sh
  2. PATH=/run/current-system/profile/bin:$PATH
  3. # Maximum Git repository size.
  4. size=$((1024 * 1024 * 100)) # 100 MB
  5. echo "#!/bin/sh"
  6. for file in /home/oleg/src/gitlab.intr/*/*
  7. do
  8. if [ -d "$file" ] && [ "$(du -s "$file" | cut -f 1)" -lt "$size" ]
  9. then
  10. echo mkdir -p "$(dirname "$file")"
  11. repository="git clone $(printf "%s $file\n" "$(git -C "$file" remote get-url origin 2>/dev/null)")"
  12. echo "$repository"
  13. fi
  14. done