mirror of
https://github.com/MustardChef/WSABuilds.git
synced 2024-11-23 11:49:16 +01:00
Selectable temporary directory locations
Uncomment `export TMPDIR=$PARENT_DIR/WORK_DIR_` to use the source directory as the working directory This allows the script to work on devices with low `/tmp` storage space close #31
This commit is contained in:
parent
1921175da6
commit
a93e299f91
@ -29,6 +29,11 @@ if [ "$HOST_ARCH" != "x86_64" ] && [ "$HOST_ARCH" != "aarch64" ]; then
|
|||||||
fi
|
fi
|
||||||
cd "$(dirname "$0")" || exit 1
|
cd "$(dirname "$0")" || exit 1
|
||||||
trap umount_clean EXIT
|
trap umount_clean EXIT
|
||||||
|
PARENT_DIR="$(dirname "$PWD")"
|
||||||
|
# export TMPDIR=$PARENT_DIR/WORK_DIR_
|
||||||
|
if [ "$TMPDIR" ] && [ ! -d "$TMPDIR" ]; then
|
||||||
|
mkdir -p "$TMPDIR"
|
||||||
|
fi
|
||||||
WORK_DIR=$(mktemp -d -t wsa-build-XXXXXXXXXX_) || exit 1
|
WORK_DIR=$(mktemp -d -t wsa-build-XXXXXXXXXX_) || exit 1
|
||||||
DOWNLOAD_DIR=../download
|
DOWNLOAD_DIR=../download
|
||||||
DOWNLOAD_CONF_NAME=download.list
|
DOWNLOAD_CONF_NAME=download.list
|
||||||
@ -51,6 +56,10 @@ umount_clean() {
|
|||||||
else
|
else
|
||||||
rm -rf "${WORK_DIR:?}"
|
rm -rf "${WORK_DIR:?}"
|
||||||
fi
|
fi
|
||||||
|
if [ "$TMPDIR" ] && [ -d "$TMPDIR" ]; then
|
||||||
|
rm -rf "${TMPDIR:?}"
|
||||||
|
unset TMPDIR
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
clean_download() {
|
clean_download() {
|
||||||
if [ -d "$DOWNLOAD_DIR" ]; then
|
if [ -d "$DOWNLOAD_DIR" ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user