mirror of
https://github.com/dockur/windows.git
synced 2024-11-23 08:43:46 +01:00
fix: Delete ISO when extraction fails (#372)
This commit is contained in:
parent
da9ef0e061
commit
56cb787c55
@ -6,6 +6,8 @@
|
|||||||
.gitmodules
|
.gitmodules
|
||||||
Dockerfile
|
Dockerfile
|
||||||
Dockerfile.archive
|
Dockerfile.archive
|
||||||
|
compose.yml
|
||||||
|
compose.yaml
|
||||||
docker-compose.yml
|
docker-compose.yml
|
||||||
|
docker-compose.yaml
|
||||||
*.md
|
*.md
|
||||||
|
@ -316,6 +316,7 @@ startInstall() {
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
rm -rf "$TMP"
|
||||||
mkdir -p "$TMP"
|
mkdir -p "$TMP"
|
||||||
|
|
||||||
if [ ! -f "$STORAGE/$CUSTOM" ]; then
|
if [ ! -f "$STORAGE/$CUSTOM" ]; then
|
||||||
@ -325,7 +326,6 @@ startInstall() {
|
|||||||
ISO="$STORAGE/$CUSTOM"
|
ISO="$STORAGE/$CUSTOM"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f "$TMP/$BASE"
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -445,6 +445,9 @@ downloadImage() {
|
|||||||
|
|
||||||
info "Failed to download $desc using Mido, will try a different method now..."
|
info "Failed to download $desc using Mido, will try a different method now..."
|
||||||
|
|
||||||
|
rm -rf "$TMP"
|
||||||
|
mkdir -p "$TMP"
|
||||||
|
|
||||||
ISO="$TMP/$VERSION.esd"
|
ISO="$TMP/$VERSION.esd"
|
||||||
iso="$ISO"
|
iso="$ISO"
|
||||||
file="$ISO"
|
file="$ISO"
|
||||||
@ -573,6 +576,7 @@ extractImage() {
|
|||||||
|
|
||||||
if [[ "${iso,,}" == *".esd" ]]; then
|
if [[ "${iso,,}" == *".esd" ]]; then
|
||||||
if ! extractESD "$iso" "$dir"; then
|
if ! extractESD "$iso" "$dir"; then
|
||||||
|
rm -f "$iso"
|
||||||
error "Failed to extract ESD file!"
|
error "Failed to extract ESD file!"
|
||||||
exit 67
|
exit 67
|
||||||
fi
|
fi
|
||||||
@ -604,6 +608,7 @@ extractImage() {
|
|||||||
rm -rf "$dir"
|
rm -rf "$dir"
|
||||||
|
|
||||||
if ! 7z x "$iso" -o"$dir" > /dev/null; then
|
if ! 7z x "$iso" -o"$dir" > /dev/null; then
|
||||||
|
rm -f "$iso"
|
||||||
error "Failed to extract ISO file!"
|
error "Failed to extract ISO file!"
|
||||||
exit 66
|
exit 66
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user