From 55fe9abfdccdf91ab55a98d9ef3304a003668466 Mon Sep 17 00:00:00 2001 From: illiliti Date: Fri, 17 Apr 2020 19:57:40 +0300 Subject: [PATCH] fix panic message duplication --- tinyramfs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tinyramfs b/tinyramfs index a2bb8fe..8721d25 100755 --- a/tinyramfs +++ b/tinyramfs @@ -6,7 +6,7 @@ # shellcheck disable=2154 # TODO add some colors ? -panic() { printf "panic >> %s\n" "$1" >&2; exit 1; } +panic() { printf "panic >> %s\n" "$1" >&2; panic=1; exit 1; } info() { printf "info >> %s\n" "$1"; } usage() @@ -482,7 +482,7 @@ create_initramfs() ret="$?" trap - EXIT INT [ "$debug" != 1 ] && remove_workdir - [ "$ret" != 0 ] && panic "something went wrong" + [ "$ret" != 0 ] && [ "$panic" != 1 ] && panic "something went wrong" ' EXIT INT create_structure