diff --git a/build.sh b/build.sh index 6228e60..b7fada4 100755 --- a/build.sh +++ b/build.sh @@ -20,11 +20,13 @@ function install_dependencies { # prints the git tag corresponding to the newest and best matching the provided kernel version $1 function get_tag { - local KERNEL_VERSION=$1 + local KERNEL_VERSION="${1}" # list all tags from newest to oldest - (git --no-pager tag -l --sort=-creatordate | grep microvm-kernel-$KERNEL_VERSION\..*\.amzn2 \ - || git --no-pager tag -l --sort=-creatordate | grep kernel-$KERNEL_VERSION\..*\.amzn2) | head -n1 + { + git --no-pager tag -l --sort=-creatordate | grep "microvm-kernel-${KERNEL_VERSION}-.*\.amzn2" \ + || git --no-pager tag -l --sort=-creatordate | grep "kernel-${KERNEL_VERSION}-.*\.amzn2" + } | head -n1 } function build_version {