From 74bc9a698dd7aeebce6f6d02677ea5f3f8f00c74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Chabowski?= Date: Thu, 22 Aug 2024 17:53:56 +0200 Subject: [PATCH] Parse chainspec output correctly regardless of the ordering of sections --- sh/scenarios/client.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sh/scenarios/client.sh b/sh/scenarios/client.sh index 848c118..5e4dd36 100755 --- a/sh/scenarios/client.sh +++ b/sh/scenarios/client.sh @@ -1312,8 +1312,8 @@ function get_chainspec_from_rpc() { OUTPUT=$($(get_path_to_client) get-chainspec \ --node-address "$(get_node_address_rpc)" \ -vv \ - | sed -n '/\[protocol\]/,$p' \ - | sed '/FAUCET/Q') + | awk '/\[.+\]/{flag=1} flag' \ + | awk '/FAUCET/{exit} {print}') # Check non-empty check_client_responded "$OUTPUT" @@ -1341,7 +1341,7 @@ function get_chainspec_json_from_rpc() { OUTPUT=$($(get_path_to_client) get-chainspec \ --node-address "$(get_node_address_rpc)" \ -vv \ - | sed '/\[protocol\]/Q') + | awk '/\[.+\]/{exit} {print}') # Check non-empty check_client_responded "$OUTPUT"