fix path sep on windows in check_go_path
License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>
Steven Allen committed
Jul 19, 2018 at 13:54 UTC
f90fffbdc89a6b6cbdc4de0e8bfadffeb1e85f65
1 file changed
+8
-1
bin/check_go_path
+8
-1
@@ -7,7 +7,14 @@ PKG="$1"
7
DIR="$(pwd -P)"
8
GOPATH="$(go env GOPATH)"
9
10
-while read -d ':' p; do
10
+# The path separator is ; on windows.
11
+if [ "$(go env GOOS)" = "windows" ]; then
12
+ PATHSEP=';'
13
+else
14
+ PATHSEP=':'
15
+fi
16
+
17
+while read -d "$PATHSEP" p; do
18
if ! cd "$p/src/$PKG" 2>/dev/null; then
19
continue
20
fi