Skip to content

Commit

Permalink
Set installer tmp path to env var (#2730)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasjrt authored Oct 15, 2024
1 parent d2cd387 commit 812e621
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ PROJECT_NAME="arduino-cli"
# BINDIR represents the local bin location, defaults to ./bin.
EFFECTIVE_BINDIR=""
DEFAULT_BINDIR="$PWD/bin"
TEMPDIR="${TMPDIR:-${TEMP:-${TMP:-/tmp}}}"

fail() {
echo "$1"
Expand Down Expand Up @@ -137,7 +138,7 @@ downloadFile() {
esac
DOWNLOAD_URL="${DOWNLOAD_URL_PREFIX}${APPLICATION_DIST}"

INSTALLATION_TMP_FILE="/tmp/$APPLICATION_DIST"
INSTALLATION_TMP_FILE="${TEMPDIR}/$APPLICATION_DIST"
echo "Downloading $DOWNLOAD_URL"
httpStatusCode=$(getFile "$DOWNLOAD_URL" "$INSTALLATION_TMP_FILE")
if [ "$httpStatusCode" -ne 200 ]; then
Expand Down Expand Up @@ -186,7 +187,7 @@ downloadFile() {
}

installFile() {
INSTALLATION_TMP_DIR="/tmp/$PROJECT_NAME"
INSTALLATION_TMP_DIR="${TEMPDIR}/$PROJECT_NAME"
mkdir -p "$INSTALLATION_TMP_DIR"
if [ "$OS" = "Windows" ]; then
unzip -d "$INSTALLATION_TMP_DIR" "$INSTALLATION_TMP_FILE"
Expand Down

0 comments on commit 812e621

Please sign in to comment.