mirror of
https://github.com/MaksTinyWorkshop/_Assistant_Lead_Tech
synced 2026-04-06 21:41:42 +02:00
fix(scripts): corriger passage CSV à python3 via pipe au lieu de heredoc
This commit is contained in:
@@ -48,23 +48,21 @@ EOF
|
||||
|
||||
# Parser le CSV avec python3 — gère les champs multilignes et les virgules dans les valeurs
|
||||
local pairs
|
||||
pairs=$(python3 - <<'PYEOF' <<< "$csv"
|
||||
pairs=$(printf '%s' "$csv" | python3 -c "
|
||||
import sys, csv, re
|
||||
|
||||
reader = csv.DictReader(sys.stdin)
|
||||
for row in reader:
|
||||
group = row.get("Group", "")
|
||||
title = row.get("Title", "")
|
||||
password = row.get("Password", "")
|
||||
if group != "Racine/global" and not group.startswith("Racine/global/"):
|
||||
group = row.get('Group', '')
|
||||
title = row.get('Title', '')
|
||||
password = row.get('Password', '')
|
||||
if group != 'Racine/global' and not group.startswith('Racine/global/'):
|
||||
continue
|
||||
if not re.match(r'^[A-Z_][A-Z0-9_]*$', title):
|
||||
if not re.match(r'^[A-Z_][A-Z0-9_]*\$', title):
|
||||
continue
|
||||
if not password:
|
||||
continue
|
||||
print(f"{title}={password}")
|
||||
PYEOF
|
||||
)
|
||||
print(title + '=' + password)
|
||||
")
|
||||
|
||||
if [ -z "$pairs" ]; then
|
||||
echo "Aucun secret global chargé." >&2
|
||||
|
||||
Reference in New Issue
Block a user