mirror of
https://github.com/MustardChef/WSABuilds.git
synced 2025-01-23 16:31:10 +01:00
Handle unexpected exit
This commit is contained in:
parent
efff5046e4
commit
95003e88e6
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
trap 'rm -rf -- "$WORK_DIR"' EXIT
|
||||||
WORK_DIR=$(mktemp -d -t wsa-build-XXXXXXXXXX_)
|
WORK_DIR=$(mktemp -d -t wsa-build-XXXXXXXXXX_) || exit 1
|
||||||
DOWNLOAD_DIR=../download
|
DOWNLOAD_DIR=../download
|
||||||
OUTPUT_DIR=../output
|
OUTPUT_DIR=../output
|
||||||
MOUNT_DIR="$WORK_DIR"/system
|
MOUNT_DIR="$WORK_DIR"/system
|
||||||
@ -34,6 +34,7 @@ abort() {
|
|||||||
fi
|
fi
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
trap abort EXIT
|
||||||
|
|
||||||
if [ ! "$BASH_VERSION" ] ; then
|
if [ ! "$BASH_VERSION" ] ; then
|
||||||
echo "Please do not use sh to run this script, just execute it directly" 1>&2
|
echo "Please do not use sh to run this script, just execute it directly" 1>&2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user