Skip to content

Commit 665cd11

Browse files
committed
Copied tmp dir logic to OS specific files
1 parent 53ee219 commit 665cd11

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

scripts/build-android-port.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
# Build Codename One Android port using JDK 11 for Maven and JDK 17 for compilation
33
set -euo pipefail
44

5-
# Normalize TMPDIR so it has no trailing slash
5+
# Normalize TMPDIR and compose paths without duplicate slashes
66
TMPDIR="${TMPDIR:-/tmp}"
77
TMPDIR="${TMPDIR%/}"
8-
DOWNLOAD_DIR="$TMPDIR/codenameone-tools"
8+
9+
# Place downloaded tools outside the repository so it isn't filled with binaries
10+
# Strip any trailing slash again at the join to be extra safe.
11+
DOWNLOAD_DIR="${TMPDIR%/}/codenameone-tools"
912
ENV_DIR="$DOWNLOAD_DIR/tools"
1013

1114
if [ -f "$ENV_DIR/env.sh" ]; then

scripts/build-ios-port.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ if ! command -v xcodebuild >/dev/null; then
1010
exit 1
1111
fi
1212

13-
# Normalize TMPDIR so it has no trailing slash
13+
# Normalize TMPDIR and compose paths without duplicate slashes
1414
TMPDIR="${TMPDIR:-/tmp}"
1515
TMPDIR="${TMPDIR%/}"
16-
DOWNLOAD_DIR="$TMPDIR/codenameone-tools"
16+
17+
# Place downloaded tools outside the repository so it isn't filled with binaries
18+
# Strip any trailing slash again at the join to be extra safe.
19+
DOWNLOAD_DIR="${TMPDIR%/}/codenameone-tools"
1720
ENV_DIR="$DOWNLOAD_DIR/tools"
1821

1922
if [ -f "$ENV_DIR/env.sh" ]; then

0 commit comments

Comments
 (0)