Skip to content

Commit

Permalink
fix: only override last extension for for automatic PR's (#238)
Browse files Browse the repository at this point in the history
its an issue since we have 3 versions of 1 ext inside the repo
  • Loading branch information
dni authored Nov 24, 2023
1 parent bea6afe commit 959e7e9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ env() {
# param: value (v0.0.0)
update_extension_attribute(){
tmp=$(mktemp)
jq --indent 4 --arg id $1 --arg key $2 --arg value $3 '( .extensions[] | select(.min_lnbits_version != null) | select(.id == $id) ) |= with_entries(if .key == $key then .value = $value else . end)' extensions.json > "$tmp" && mv "$tmp" extensions.json
version=$(jq -r --arg id $1 '[.extensions[] | select(.id == $id)] | last | .version' ./extensions.json)
jq_cmd_string='( .extensions[] | select(.id == $id) | select(.version == $version) ) |= with_entries(if .key == $key then .value = $value else . end)'
jq --indent 4 --arg id $1 --arg key $2 --arg value $3 --arg version $version "$jq_cmd_string" extensions.json > "$tmp" && mv "$tmp" extensions.json
}

# param: extension id (example)
Expand Down

0 comments on commit 959e7e9

Please sign in to comment.