diff options
Diffstat (limited to 'functions/stagefile.sh')
-rwxr-xr-x | functions/stagefile.sh | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/functions/stagefile.sh b/functions/stagefile.sh index a570ea2..b4938cc 100755 --- a/functions/stagefile.sh +++ b/functions/stagefile.sh @@ -47,13 +47,28 @@ Create_stagefile () Require_stagefile () { - FILE="${1}" - NAME="`basename ${1}`" + FILES="${@}" + NUMBER="`echo ${@} | wc -w`" - # Checking stage file - if [ ! -f "${FILE}" ] + for FILE in ${FILES} + do + # Find at least one of the required stages + if [ -f ${FILE} ] + then + CONTINUE="true" + NAME="${NAME} `basename ${FILE}`" + fi + done + + if [ "${CONTINUE}" != "true" ] then - Echo_error "${NAME} missing" + if [ "${NUMBER}" -gt 1 ] + then + Echo_error "one of ${NAME} is missing" + else + Echo_error "${NAME} missing" + fi + exit 1 fi } |