Skip to content

Commit a01d53d

Browse files
committed
Set installer tmp path to env var
1 parent 0540cee commit a01d53d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: install.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ PROJECT_NAME="arduino-cli"
1010
# BINDIR represents the local bin location, defaults to ./bin.
1111
EFFECTIVE_BINDIR=""
1212
DEFAULT_BINDIR="$PWD/bin"
13+
TEMPDIR="${TMPDIR:-${TEMP:-${TMP:-/tmp}}}"
1314

1415
fail() {
1516
echo "$1"
@@ -137,7 +138,7 @@ downloadFile() {
137138
esac
138139
DOWNLOAD_URL="${DOWNLOAD_URL_PREFIX}${APPLICATION_DIST}"
139140

140-
INSTALLATION_TMP_FILE="/tmp/$APPLICATION_DIST"
141+
INSTALLATION_TMP_FILE="${TEMPDIR}/$APPLICATION_DIST"
141142
echo "Downloading $DOWNLOAD_URL"
142143
httpStatusCode=$(getFile "$DOWNLOAD_URL" "$INSTALLATION_TMP_FILE")
143144
if [ "$httpStatusCode" -ne 200 ]; then
@@ -186,7 +187,7 @@ downloadFile() {
186187
}
187188

188189
installFile() {
189-
INSTALLATION_TMP_DIR="/tmp/$PROJECT_NAME"
190+
INSTALLATION_TMP_DIR="${TEMPDIR}/$PROJECT_NAME"
190191
mkdir -p "$INSTALLATION_TMP_DIR"
191192
if [ "$OS" = "Windows" ]; then
192193
unzip -d "$INSTALLATION_TMP_DIR" "$INSTALLATION_TMP_FILE"

0 commit comments

Comments
 (0)