nixos-config/scripts/code-repo-to-csv.sh

17 lines
462 B
Bash
Raw Normal View History

2025-03-01 23:09:58 +03:00
#!/usr/bin/env bash
now="$(date +'%d/%m/%Y %T')"
cd ~/Code/
echo "datetime_create,datetime_latest,\"Dossier *\",\"Dépot git *\",\"Branche par défaut\",Description" > code.csv
for i in */.git; do (
cd $i/..;
dir=${i/\/.git/}
branch="$(git branch --show-current)"
cd ~/Code/$i
repo="$(cat config | grep "url ="| tr -d '[:space:]')"
repo="${repo/url=/}"
cd ~/Code/
echo "\"$now\",\"$now\",$dir,$repo,$branch,$dir") >> code.csv;
done
cd ~/Code/