Skip to content

Commit

Permalink
Ensure temp dir is always unique
Browse files Browse the repository at this point in the history
  • Loading branch information
Naatan committed Sep 18, 2023
1 parent 6e3fcd6 commit e26f6b9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions installers/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ if [ -z "$TMPDIR" ]; then
TMPDIR="/tmp"
fi

TMPDIR="$TMPDIR/state-install-$RANDOM"
mkdir -p "$TMPDIR"

if [ -z "$VERSION" ]; then
# Determine the latest version to fetch.
STATEURL="$BASE_INFO_URL?channel=$CHANNEL&source=install&platform=$OS"
Expand Down Expand Up @@ -173,3 +176,6 @@ echo ""

# Run the installer.
ACTIVESTATE_SESSION_TOKEN=$SESSION_TOKEN_VALUE $TMPDIR/$INSTALLERNAME$BINARYEXT "$@" --source-installer="install.sh"

# Remote temp files
rm -r $TMPDIR

0 comments on commit e26f6b9

Please sign in to comment.