Skip to content

Commit a7e29fe

Browse files
bfb-tool: Add error for missing version information in BFB files
Signed-off-by: Vladimir Sokolovsky <[email protected]>
1 parent 0545a1e commit a7e29fe

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

scripts/bfb-tool

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,25 @@ cd $WDIR
250250

251251
if [ $GET_INFO -eq 1 ]; then
252252
$MLX_MKBFB -x -n info-v0 $bfb
253-
if [ $JSON -eq 1 ]; then
254-
cat dump-info-v0
253+
if [ -e dump-info-v0 ]; then
254+
if [ $JSON -eq 1 ]; then
255+
cat dump-info-v0
256+
else
257+
cat dump-info-v0 | jq '.Members[] |"\(.Name): \(.Version)"' | tr -d '"'
258+
fi
255259
else
256-
cat dump-info-v0 | jq '.Members[] |"\(.Name): \(.Version)"' | tr -d '"'
260+
if [ $JSON -eq 1 ]; then
261+
cat << EOF
262+
{
263+
"error": {
264+
"message": "This BFB file does not contain version information."
265+
}
266+
}
267+
EOF
268+
else
269+
error "This BFB file does not contain version information."
270+
fi
271+
exit 1
257272
fi
258273
cd - > /dev/null 2>&1
259274

0 commit comments

Comments
 (0)