From ac7e1a86c49766b04397185baf3514a7df2a22b6 Mon Sep 17 00:00:00 2001 From: 35C4n0r Date: Sat, 23 May 2026 14:00:46 +0000 Subject: [PATCH] debug --- .../modules/codex/scripts/install.sh.tftpl | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/registry/coder-labs/modules/codex/scripts/install.sh.tftpl b/registry/coder-labs/modules/codex/scripts/install.sh.tftpl index dfd3edec..77ad2979 100644 --- a/registry/coder-labs/modules/codex/scripts/install.sh.tftpl +++ b/registry/coder-labs/modules/codex/scripts/install.sh.tftpl @@ -154,13 +154,19 @@ function merge_toml_config() { return fi - local merge_tmp - merge_tmp="$(mktemp)" + local merge_tmp existing_json new_json + merge_tmp=$(mktemp) + existing_json=$(mktemp) + new_json=$(mktemp) echo "$${content}" > "$${merge_tmp}" - dasel -i toml -o toml "{parse(\"toml\", readFile(\"$${merge_tmp}\"))..., \$root...}" \ - < "$${config_path}" > "$${config_path}.tmp" \ + + dasel -i toml -o json < "$${config_path}" > "$${existing_json}" + dasel -i toml -o json < "$${merge_tmp}" > "$${new_json}" + + jq -s '.[0] * .[1]' "$${new_json}" "$${existing_json}" \ + | dasel -i json -o toml > "$${config_path}.tmp" \ && mv "$${config_path}.tmp" "$${config_path}" - rm -f "$${merge_tmp}" + rm -f "$${merge_tmp}" "$${existing_json}" "$${new_json}" } function write_minimal_default_config() {