diff --git a/script/install.sh b/script/install.sh index 9cd21119b7d9349d5d9fd5e4e4ebcf9bd2588d18..feb140c9843c680502fb07ced3f8be7fc8559136 100755 --- a/script/install.sh +++ b/script/install.sh @@ -9,7 +9,12 @@ main() { platform="$(uname -s)" arch="$(uname -m)" channel="${ZED_CHANNEL:-stable}" - temp="$(mktemp -d "/tmp/zed-XXXXXX")" + # Use TMPDIR if available (for environments with non-standard temp directories) + if [ -n "${TMPDIR:-}" ] && [ -d "${TMPDIR}" ]; then + temp="$(mktemp -d "$TMPDIR/zed-XXXXXX")" + else + temp="$(mktemp -d "/tmp/zed-XXXXXX")" + fi if [ "$platform" = "Darwin" ]; then platform="macos"