executable_gita-kitnil 567 B

1234567891011121314151617181920212223
  1. #!/usr/bin/env bash
  2. set -eu
  3. TERRAFORM_FILE="${TERRAFORM_FILE:-$HOME/.local/share/chezmoi/dotfiles/maintenance/github/projects.tf}"
  4. config()
  5. {
  6. awk '/github_repository/ { gsub("\"",""); print $3 }' "$TERRAFORM_FILE" | while IFS= read -r repository
  7. do
  8. while IFS= read -r -d '' directory
  9. do
  10. echo "$directory,$(basename "$directory")"
  11. done < <(find "$HOME/src" "$HOME/archive/src" -maxdepth 1 -type d -name "$repository" -print0)
  12. done
  13. }
  14. cat > "$HOME/.config/gita/repo_path" <<EOF
  15. $(config)
  16. EOF
  17. exec -a "gita" gita "$@"