From 7a3fcdcfafbd52a50f4261fd49dee88b19d5f4f9 Mon Sep 17 00:00:00 2001 From: Jarred Wilson Date: Thu, 22 Aug 2024 01:20:43 +0000 Subject: [PATCH] fix:[#1525] handle container creation failure print error message and exit with subprocess return code --- distrobox-create | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/distrobox-create b/distrobox-create index f34ea1c536..61761a8d5f 100755 --- a/distrobox-create +++ b/distrobox-create @@ -1047,6 +1047,8 @@ if eval ${cmd} > /dev/null; then "${distrobox_genentry_path}" "${container_name}" fi fi - exit $? +else + error="$?" + printf >&2 "\033[31m [ ERR ]\033[0m failed to create container.\n" + exit ${error} fi -printf >&2 "\033[31m [ ERR ]\n\033[0m"