Skip to content

Commit 78f89bc

Browse files
committed
update.sh: fix mktemp on BSD/OS X, only use one directory
1 parent 29f4fef commit 78f89bc

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

playground/update.sh

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
#!/bin/sh
22
set -e
33

4-
tmp_gopath=$(mktemp -d --suffix _play_gopath)
5-
tmp_goroot=$(mktemp -d --suffix _play_goroot)
4+
tmp=$(mktemp -d "${TMPDIR:-/tmp}/gopherjs_playground.XXXXXXXXXX")
65

76
cleanup() {
8-
rm -rf "$tmp_gopath"
9-
rm -rf "$tmp_goroot"
7+
rm -rf "$tmp"
108
exit
119
}
1210

@@ -27,7 +25,7 @@ rm -r "$PKG"
2725

2826
# Use an empty GOPATH workspace with just gopherjs,
2927
# so that all the standard library packages get written to GOROOT/pkg.
30-
export GOPATH="$tmp_gopath"
28+
export GOPATH="$tmp/gopath"
3129
mkdir -p "$GOPATH"/src/github.com/gopherjs/gopherjs
3230
cp -a "$GOPHERJSGOPATH"/src/github.com/gopherjs/gopherjs/* "$GOPATH"/src/github.com/gopherjs/gopherjs
3331

@@ -38,8 +36,8 @@ cp "$GOPATH"/pkg/*_js_min/github.com/gopherjs/gopherjs/nosync.a "$PKG"/github.co
3836

3937
# Make a copy of GOROOT that is user-writeable,
4038
# use it to build and copy out standard library packages.
41-
cp -a "$(go env GOROOT)" "$tmp_goroot"
42-
export GOROOT="$tmp_goroot"
39+
cp -a "$(go env GOROOT)" "$tmp/goroot"
40+
export GOROOT="$tmp/goroot"
4341
gopherjs install -m \
4442
archive/tar \
4543
archive/zip \

0 commit comments

Comments
 (0)