From 28da9e391ed06dbaa9791c5d1831c3a9fcacaab1 Mon Sep 17 00:00:00 2001 From: Kroese Date: Sat, 13 Apr 2024 17:07:02 +0200 Subject: [PATCH] fix: Delete ISO when extraction fails (#59) --- .dockerignore | 3 +++ src/install.sh | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index 2cf7b5a..5deda07 100644 --- a/.dockerignore +++ b/.dockerignore @@ -6,6 +6,9 @@ .gitmodules Dockerfile Dockerfile.archive +compose.yml +compose.yaml docker-compose.yml +docker-compose.yaml *.md diff --git a/src/install.sh b/src/install.sh index 7be6b06..84aaa3b 100644 --- a/src/install.sh +++ b/src/install.sh @@ -193,7 +193,6 @@ startInstall() { ISO="$STORAGE/$CUSTOM" fi - rm -f "$TMP/$BASE" return 0 } @@ -413,6 +412,7 @@ extractImage() { if [[ "${iso,,}" == *".esd" ]]; then if ! extractESD "$iso" "$dir"; then error "Failed to extract ESD file!" + rm -f "$iso" exit 67 fi return 0 @@ -444,6 +444,7 @@ extractImage() { if ! 7z x "$iso" -o"$dir" > /dev/null; then error "Failed to extract ISO file!" + rm -f "$iso" exit 66 fi