Windows build: Clean up after abnormal exits

This commit is contained in:
Richard Hansen 2022-05-12 20:16:47 -04:00
parent e71f69ec72
commit 1dc3c4bde9

View file

@ -22,6 +22,8 @@ try cd "${workdir}"
OUTPUT=${workdir}/etherpad-win.zip
TMP_FOLDER=$(try mktemp -d) || exit 1
trap 'exit 1' HUP INT TERM
trap 'log "cleaning up..."; try cd / && try rm -rf "${TMP_FOLDER}"' EXIT
log "create a clean environment in $TMP_FOLDER..."
try cp -ar . "$TMP_FOLDER"
@ -58,7 +60,4 @@ log "create the zip..."
try cd "$TMP_FOLDER"
try zip -9 -r "${OUTPUT}" ./* -x var
log "clean up..."
try rm -rf "$TMP_FOLDER"
log "Finished. You can find the zip at ${OUTPUT}"