From 41c9435adfca1f6e4116799b831eae99a89eee24 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Thu, 17 Oct 2019 20:02:56 +0000 Subject: [PATCH] BuildSourceImage: shell traps unused so far, but we may likely want some cleanup place --- BuildSourceImage.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/BuildSourceImage.sh b/BuildSourceImage.sh index 59b08f7..48114ee 100755 --- a/BuildSourceImage.sh +++ b/BuildSourceImage.sh @@ -48,6 +48,16 @@ _init() { done } +cleanup() { + local ret=$? + if [ ${ret} -ne 0 ] ; then + echo "" + _warn "cleaning up" + fi + exit "${ret}" +} +trap "cleanup" EXIT TERM KILL + # enable access to some of functions as subcommands! _subcommand() { local command="${1}" @@ -1061,6 +1071,8 @@ main() { local unpack_dir local work_dir +sleep 10 + _init "${@}" _subcommand "${@}"