Skip to content

Commit 56cb787

Browse files
authored
fix: Delete ISO when extraction fails (#372)
1 parent da9ef0e commit 56cb787

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.dockerignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
.gitmodules
77
Dockerfile
88
Dockerfile.archive
9+
compose.yml
10+
compose.yaml
911
docker-compose.yml
10-
12+
docker-compose.yaml
1113
*.md

src/install.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ startInstall() {
316316

317317
fi
318318

319+
rm -rf "$TMP"
319320
mkdir -p "$TMP"
320321

321322
if [ ! -f "$STORAGE/$CUSTOM" ]; then
@@ -325,7 +326,6 @@ startInstall() {
325326
ISO="$STORAGE/$CUSTOM"
326327
fi
327328

328-
rm -f "$TMP/$BASE"
329329
return 0
330330
}
331331

@@ -445,6 +445,9 @@ downloadImage() {
445445

446446
info "Failed to download $desc using Mido, will try a different method now..."
447447

448+
rm -rf "$TMP"
449+
mkdir -p "$TMP"
450+
448451
ISO="$TMP/$VERSION.esd"
449452
iso="$ISO"
450453
file="$ISO"
@@ -573,6 +576,7 @@ extractImage() {
573576

574577
if [[ "${iso,,}" == *".esd" ]]; then
575578
if ! extractESD "$iso" "$dir"; then
579+
rm -f "$iso"
576580
error "Failed to extract ESD file!"
577581
exit 67
578582
fi
@@ -604,6 +608,7 @@ extractImage() {
604608
rm -rf "$dir"
605609

606610
if ! 7z x "$iso" -o"$dir" > /dev/null; then
611+
rm -f "$iso"
607612
error "Failed to extract ISO file!"
608613
exit 66
609614
fi

0 commit comments

Comments
 (0)