summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorruki <[email protected]>2019-07-30 00:35:58 +0800
committerruki <[email protected]>2019-07-29 21:35:52 +0800
commitb1fedbe9b53901a7118814e65f4975f76cb222fc (patch)
tree6d16d7741ee9fbf3573740846a8812fed3a75f03 /scripts
parentabb4be3c4cae7a1d663c4eac01d43d7b1458de9c (diff)
improve get.sh
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/get.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/get.sh b/scripts/get.sh
index 406f952bc..9245c954d 100755
--- a/scripts/get.sh
+++ b/scripts/get.sh
@@ -5,14 +5,17 @@
set -o pipefail
-if [ 0 -ne "$(id -u)" ]
-then
+if [ 0 -ne "$(id -u)" ]; then
sudoprefix=sudo
else
sudoprefix=
fi
-tmpdir=/tmp/.xmake_getter$$
+if [ -z "$TMPDIR" ]; then
+ tmpdir=/tmp/.xmake_getter$$
+else
+ tmpdir=$TMPDIR
+fi
remote_get_content(){
if curl --version >/dev/null 2>&1