Skip to content

Commit

Permalink
fix path sep on windows in check_go_path
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Steven Allen <[email protected]>
  • Loading branch information
Stebalien committed Jul 19, 2018
1 parent 2483288 commit d762db5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions bin/check_go_path
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@ PKG="$1"
DIR="$(pwd -P)"
GOPATH="$(go env GOPATH)"

while read -d ':' p; do
if ! cd "$p/src/$PKG" 2>/dev/null; then
continue
fi
# The path separator is ; on windows.
if [ "$(go env GOOS)" = "windows" ]; then
PATHSEP=';'
else
PATHSEP=':'
fi

while read -d "$PATHSEP" p; do
[ -d "$p/src/$PKG/" ] || continue
cd "$p/src/$PKG" || continue

if [ "$DIR" = "$(pwd -P)" ]; then
exit 0
Expand Down

0 comments on commit d762db5

Please sign in to comment.