From 067f44413f002a3aa3d8d197fb52b2a3bf5231d0 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Tue, 29 Nov 2022 17:34:16 +0100 Subject: [PATCH] json2nix: fix output when expr is raw string --- searchers/home-manager-search.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/searchers/home-manager-search.nix b/searchers/home-manager-search.nix index 0e7e3e6..61fd594 100644 --- a/searchers/home-manager-search.nix +++ b/searchers/home-manager-search.nix @@ -58,11 +58,11 @@ let EXAMPLE_DATA=$(echo $JSON_DATA | ${jq} -r ".example.text" 2>/dev/null | ${nixfmt}) if [ $? != 0 ]; then - EXAMPLE_DATA=$(echo $JSON_DATA | ${jq} -r ".example" | ${json2nix}/bin/json2nix) + EXAMPLE_DATA=$(echo $JSON_DATA | ${jq} ".example" | ${json2nix}/bin/json2nix) fi export EXAMPLE=$(echo $EXAMPLE_DATA | ${bat} ${batColorArg}--style=numbers -lnix) - export DEFAULT=$(echo $JSON_DATA | ${jq} -r ".default" | ${json2nix}/bin/json2nix | ${bat} ${batColorArg}--style=numbers -lnix) + export DEFAULT=$(echo $JSON_DATA | ${jq} ".default" | ${json2nix}/bin/json2nix | ${bat} ${batColorArg}--style=numbers -lnix) echo $JSON_DATA | ${gomplate} --datasource opt=stdin:?type=application/json --file ${template} '';