Skip to content

Commit 6091176

Browse files
authored
Default downloads to subdir of /data (#476)
1 parent ee01883 commit 6091176

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

bedrock-entry.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -eo pipefail
44

5-
: "${TMP_DIR:=/tmp}"
5+
: "${DOWNLOAD_DIR:=${PWD}/.downloads}"
66
: "${PREVIEW:=false}"
77

88
function isTrue() {
@@ -67,7 +67,7 @@ if [[ ${DEBUG^^} == TRUE ]]; then
6767
echo " current directory is $(pwd)"
6868
fi
6969

70-
export HOME=/data
70+
export HOME="${PWD}"
7171

7272
downloadPage=https://www.minecraft.net/en-us/download/server/bedrock
7373

@@ -104,8 +104,8 @@ esac
104104

105105
if [[ ! -f "bedrock_server-${VERSION}" ]]; then
106106

107-
[[ $TMP_DIR != /tmp ]] && mkdir -p "$TMP_DIR"
108-
TMP_ZIP="$TMP_DIR/$(basename "${DOWNLOAD_URL}")"
107+
[[ $DOWNLOAD_DIR != /tmp ]] && mkdir -p "$DOWNLOAD_DIR"
108+
TMP_ZIP="$DOWNLOAD_DIR/$(basename "${DOWNLOAD_URL}")"
109109

110110
echo "Downloading Bedrock server version ${VERSION} ..."
111111
if ! curl "${curlArgs[@]}" -o "${TMP_ZIP}" -A "itzg/minecraft-bedrock-server" -fsSL "${DOWNLOAD_URL}"; then
@@ -146,7 +146,7 @@ if [[ ! -f "bedrock_server-${VERSION}" ]]; then
146146
# Do not overwrite existing files, which means the cleanup above needs to account for things
147147
# that MUST be replaced on upgrade
148148
unzip -q -n "${TMP_ZIP}"
149-
[[ $TMP_DIR != /tmp ]] && rm -rf "$TMP_DIR"
149+
[[ $DOWNLOAD_DIR != /tmp ]] && rm -rf "$DOWNLOAD_DIR"
150150

151151
chmod +x bedrock_server
152152
mv bedrock_server "bedrock_server-${VERSION}"

0 commit comments

Comments
 (0)