From 43ff815d9fa05eca70d128eaa444be5613897958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Petazzoni?= Date: Sun, 27 Apr 2025 14:03:02 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20Fix=20tabs=20in=20logins.jsonl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- prepare-labs/lib/commands.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/prepare-labs/lib/commands.sh b/prepare-labs/lib/commands.sh index 2e621527..4b26c445 100644 --- a/prepare-labs/lib/commands.sh +++ b/prepare-labs/lib/commands.sh @@ -374,9 +374,13 @@ _cmd_clusterize() { done < /tmp/cluster " - while read line; do - printf '{"login": "%s", "password": "%s", "ipaddrs": "%s"}\n' "$USER_LOGIN" "$USER_PASSWORD" "$line" - done < tags/$TAG/clusters.tsv > tags/$TAG/logins.jsonl + jq --raw-input --compact-output \ + --arg USER_LOGIN "$USER_LOGIN" --arg USER_PASSWORD "$USER_PASSWORD" ' + { + "login": $USER_LOGIN, + "password": $USER_PASSWORD, + "ipaddrs": . + }' < tags/$TAG/clusters.tsv > tags/$TAG/logins.jsonl echo cluster_ok > tags/$TAG/status }