summaryrefslogtreecommitdiff
path: root/src/sudo.bash
diff options
context:
space:
mode:
Diffstat (limited to 'src/sudo.bash')
-rwxr-xr-xsrc/sudo.bash17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/sudo.bash b/src/sudo.bash
index 147e58f15..cccebd342 100755
--- a/src/sudo.bash
+++ b/src/sudo.bash
@@ -4,7 +4,6 @@
# license that can be found in the LICENSE file.
set -e
-. ./env.bash
case "`uname`" in
Darwin)
@@ -13,9 +12,19 @@ Darwin)
exit 0
esac
+if [[ ! -d /usr/local/bin ]]; then
+ echo 1>&2 'sudo.bash: problem with /usr/local/bin; cannot install tools.'
+ exit 2
+fi
+
+eval $(go env)
+cd $(dirname $0)
for i in prof cov
do
- sudo cp "$GOROOT"/src/cmd/$i/6$i /usr/local/bin/6$i
- sudo chgrp procmod /usr/local/bin/6$i
- sudo chmod g+s /usr/local/bin/6$i
+ # Remove old binaries if present
+ sudo rm -f /usr/local/bin/6$i
+ # Install new binaries
+ sudo cp $GOTOOLDIR/$i /usr/local/bin/go$i
+ sudo chgrp procmod /usr/local/bin/go$i
+ sudo chmod g+s /usr/local/bin/go$i
done