Skip to content

Commit

Permalink
migrate.sh: fix parsing/formatting regressions
Browse files Browse the repository at this point in the history
- DEVICE_INITIAL_SDK_INT value would erroneously be used for DEVICE if DEVICE was missing
- a malformed json trailing , on the last input file entry would break the output format
  • Loading branch information
osm0sis authored Apr 7, 2024
1 parent b4821fb commit 25262ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/migrate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ esac;

item() { echo "- $@"; }
die() { [ "$INSTALL" ] || echo "$N$N! $@"; exit 1; }
grep_get_json() { eval set -- "$(cat "$FILE" | tr -d '\r\n' | grep -m1 -o "$1"'.*' | cut -d: -f2-)"; echo "$1" | sed -e 's|"|\\\\\\"|g' -e 's/[,}]$//'; }
grep_get_json() { eval set -- "$(cat "$FILE" | tr -d '\r\n' | grep -m1 -o "\"$1\""'.*' | cut -d: -f2-)"; echo "$1" | sed -e 's|"|\\\\\\"|g' -e 's|[,}]*$||'; }
grep_check_json() { grep -q "$1" "$FILE" && [ "$(grep_get_json $1)" ]; }

case "$1" in
Expand Down

0 comments on commit 25262ce

Please sign in to comment.