executable_gita-src 372 B

1234567891011121314151617181920
  1. #!/usr/bin/env bash
  2. set -e
  3. DIRECTORIES=("$HOME/src" "$HOME/archive/src")
  4. config()
  5. {
  6. while IFS= read -r -d '' directory
  7. do
  8. echo "$(dirname "$directory"),$(basename "$(dirname "$directory")")"
  9. done < <(find "${DIRECTORIES[@]}" -maxdepth 2 -type d -name .git -print0)
  10. }
  11. cat > "$HOME/.config/gita/repo_path" <<EOF
  12. $(config)
  13. EOF
  14. exec -a "$0" gita "$@"