From 7ee1a6fe79355c21e501e168a3b3aa31190bdaa1 Mon Sep 17 00:00:00 2001 From: trueberryless Date: Sun, 24 Nov 2024 13:54:32 +0100 Subject: [PATCH] pls deploy --- .github/workflows/sync.yaml | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/.github/workflows/sync.yaml b/.github/workflows/sync.yaml index 695c489..2b76e96 100644 --- a/.github/workflows/sync.yaml +++ b/.github/workflows/sync.yaml @@ -154,31 +154,7 @@ jobs: fi elif [[ "$dest_file" == "package.json" ]]; then echo "Special handling for package.json" - - # Iterate over each key in src_file and merge or update values in dest_file - jq --argfile template "../$src_file" \ - --argfile current "$dest_file" \ - ' - # For each key in the template, check if it exists in the current (dest_file) - # If it exists and the value is different, update it. If not, add it. - reduce (keys_unsorted($template) | .[]) as $key ( - $current; - if has($key) then - # If the key exists, check if the value is different, then update it - if ($current[$key] != $template[$key]) then - .[$key] = $template[$key] - else - . # Keep the existing value if it matches - end - else - # If the key doesn't exist, add it - .[$key] = $template[$key] - end - ) - ' > temp_package.json - - # Move the processed JSON back to the destination file - mv temp_package.json "$dest_file" + jq -s 'reduce .[] as $item ({}; . * $item)' "$src_file" "$dest_file" > "$dest_file.tmp" && mv "$dest_file.tmp" "$dest_file" fi else # Prepare the destination directory