summaryrefslogtreecommitdiff
path: root/src/env.bash
diff options
context:
space:
mode:
Diffstat (limited to 'src/env.bash')
-rw-r--r--src/env.bash10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/env.bash b/src/env.bash
index c1055d561..ca3ecebe8 100644
--- a/src/env.bash
+++ b/src/env.bash
@@ -3,6 +3,16 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
+# If set to a Windows-style path convert to an MSYS-Unix
+# one using the built-in shell commands.
+if [[ "$GOROOT" == *:* ]]; then
+ GOROOT=$(cd "$GOROOT"; pwd)
+fi
+
+if [[ "$GOBIN" == *:* ]]; then
+ GOBIN=$(cd "$GOBIN"; pwd)
+fi
+
export GOROOT=${GOROOT:-$(cd ..; pwd)}
if ! test -f "$GOROOT"/include/u.h