mkimage.sh: also handle json file as source

This commit is contained in:
Harald Hoyer 2018-09-14 11:36:47 +02:00
parent bb548a3d90
commit 090dd46a8e

View file

@ -70,6 +70,10 @@ done
SOURCE=$(readlink -e "$1")
IMAGE=$(readlink -f "$2")
if ! [[ -d $SOURCE ]]; then
SOURCE="${SOURCE%/*}/$(jq -r '.name' "$SOURCE")-$(jq -r '.version' "$SOURCE")"
fi
if ! [[ -d $SOURCE ]] || ! [[ $IMAGE ]]; then
usage
exit 1