mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-21 21:51:57 +02:00
build_library: use jq to parse JSON
This commit is contained in:
parent
a204e434c6
commit
f0618ab541
@ -169,8 +169,7 @@ assert_image_size() {
|
|||||||
|
|
||||||
local size
|
local size
|
||||||
size=$(qemu-img info -f "${disk_type}" --output json "${disk_img}" | \
|
size=$(qemu-img info -f "${disk_type}" --output json "${disk_img}" | \
|
||||||
gawk 'match($0, /"virtual-size": ([0-9]+),/, val) {print val[1]}' ; \
|
jq --raw-output '.["virtual-size"]' ; exit ${PIPESTATUS[0]})
|
||||||
exit ${PIPESTATUS[0]})
|
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
die_notrace "assert failed: could not read image size"
|
die_notrace "assert failed: could not read image size"
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user