Skip to content

Commit 97f92c7

Browse files
committed
update.sh: eliminate $pkg variable
1 parent 825a4b3 commit 97f92c7

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

playground/update.sh

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ gopherjs build -m
2020
# The GOPATH workspace where the GopherJS project is.
2121
gopherjsgopath=$(go list -f '{{.Root}}' github.com/gopherjs/gopherjs)
2222

23-
pkg=pkg
24-
rm -r "$pkg"
23+
rm -r pkg/
2524

2625
# Use an empty GOPATH workspace with just gopherjs,
2726
# so that all the standard library packages get written to GOROOT/pkg.
@@ -30,9 +29,9 @@ mkdir -p "$GOPATH"/src/github.com/gopherjs/gopherjs
3029
cp -a "$gopherjsgopath"/src/github.com/gopherjs/gopherjs/* "$GOPATH"/src/github.com/gopherjs/gopherjs
3130

3231
gopherjs install -m github.com/gopherjs/gopherjs/js github.com/gopherjs/gopherjs/nosync
33-
mkdir -p "$pkg"/github.com/gopherjs/gopherjs
34-
cp "$GOPATH"/pkg/*_js_min/github.com/gopherjs/gopherjs/js.a "$pkg"/github.com/gopherjs/gopherjs/js.a
35-
cp "$GOPATH"/pkg/*_js_min/github.com/gopherjs/gopherjs/nosync.a "$pkg"/github.com/gopherjs/gopherjs/nosync.a
32+
mkdir -p pkg/github.com/gopherjs/gopherjs
33+
cp "$GOPATH"/pkg/*_js_min/github.com/gopherjs/gopherjs/js.a pkg/github.com/gopherjs/gopherjs/js.a
34+
cp "$GOPATH"/pkg/*_js_min/github.com/gopherjs/gopherjs/nosync.a pkg/github.com/gopherjs/gopherjs/nosync.a
3635

3736
# Make a copy of GOROOT that is user-writeable,
3837
# use it to build and copy out standard library packages.
@@ -137,8 +136,8 @@ gopherjs install -m \
137136
unicode/utf16 \
138137
unicode/utf8
139138

140-
cp -a "$GOROOT"/pkg/*_js_min/* $pkg
141-
cp -a "$GOROOT"/pkg/*_amd64_js_min/* $pkg
139+
cp -a "$GOROOT"/pkg/*_js_min/* pkg/
140+
cp -a "$GOROOT"/pkg/*_amd64_js_min/* pkg/
142141

143-
# Rename all *.a files in $pkg to *.a.js.
144-
find "$pkg" -name "*.a" -exec sh -c 'mv $0 $0.js' {} \;
142+
# Rename all *.a files in pkg/ to *.a.js.
143+
find pkg -name "*.a" -exec sh -c 'mv $0 $0.js' {} \;

0 commit comments

Comments
 (0)