From 090dd46a8e3a98016a96cacdc59d47d0d4b56587 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 14 Sep 2018 11:36:47 +0200 Subject: [PATCH] mkimage.sh: also handle json file as source --- mkimage.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mkimage.sh b/mkimage.sh index d7a1dde..34e57f9 100755 --- a/mkimage.sh +++ b/mkimage.sh @@ -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