From 98e943037c96922d1eaa277e3717759134783b56 Mon Sep 17 00:00:00 2001 From: David Kebler Date: Sat, 22 Apr 2023 09:21:50 -0700 Subject: [PATCH] move command 'image info exists' to just 'image exists' check for bad environment file formatting --- build | 2 +- lib/build.lib | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/build b/build index b121df9..af27fe0 100755 --- a/build +++ b/build @@ -39,11 +39,11 @@ case "$1" in tag) shift 1; image_tag "$@" ;; push) shift 1; image_push "$@" ;; delete) shift 1; image_delete "$@" ;; + exists) shift 1; image_exists "$@" ;; info) shift 1 case "$1" in arch) shift 1; image_arch "$@" ;; - exists) shift 1; image_exists "$@" ;; tags) shift 1; image_tags "$@" ;; id) shift 1; image_id "$@" ;; * ) image_info "$@" diff --git a/lib/build.lib b/lib/build.lib index 9f04cde..066a500 100755 --- a/lib/build.lib +++ b/lib/build.lib @@ -64,6 +64,15 @@ read_env_file() { local evar while read line; do evar=$(echo $line | cut -d '=' -f1) + if [[ $(echo $(c() { echo $#; }; c $line)) -gt 1 ]];then + echo the environment file: $1 + echo has a format error on this line + echo "--------------" + echo $line + echo "--------------" + echo you must correct this before the build can continue + return 1 + fi if [[ ! ${!evar} ]]; then # echo DECLARE $evar via $line if declare -gx "$(echo "${line}" | sed 's/\"//g' )"; then