executable_gita-mjru 1019 B

123456789101112131415161718192021222324252627282930313233
  1. #!/usr/bin/env bash
  2. set -e
  3. config()
  4. {
  5. while IFS= read -r -d '' directory
  6. do
  7. project_name="$(basename "$directory")"
  8. group_name="$(basename "$(dirname "$directory")")"
  9. if [[ -f $directory/.git ]]
  10. then
  11. :
  12. else
  13. echo "${directory},${group_name}-${project_name}"
  14. fi
  15. done < <(find "${HOME}/src/gitlab.intr" -maxdepth 2 -type d -print0)
  16. }
  17. cat > "${HOME}/.config/gita/repo_path" <<EOF
  18. $(config)
  19. EOF
  20. cat > "${HOME}/.config/gita/groups.yml" <<EOF
  21. php: [webservices-apache2-php44, webservices-apache2-php52, webservices-apache2-php53,
  22. webservices-apache2-php54, webservices-apache2-php55, webservices-apache2-php70,
  23. webservices-apache2-php71, webservices-apache2-php72, webservices-apache2-php73,
  24. webservices-apache2-php74, webservices-apache2-php80, webservices-apache2-perl518,
  25. webservices-apache2-php74-personal]
  26. EOF
  27. exec -a "$0" sshpass -Ppassphrase -p"$(pass show majordomo/private/gitlab.intr/ssh/id_rsa_gitlab_intr)" gita "$@"