-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix check_go_path when it has spaces in it #5261
Conversation
fixes #5260 License: MIT Signed-off-by: Steven Allen <[email protected]>
So, circleci doesn't have realpath... Is that really necessary? |
Doesn't |
It doesn't exist on all operating systems. License: MIT Signed-off-by: Steven Allen <[email protected]>
bin/check_go_path
Outdated
exit 0 | ||
fi | ||
cd "$DIR" | ||
done <<< "$GOPATH:" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI is unhappy about this, probably want to switch to #!/usr/bin/env bash
License: MIT Signed-off-by: Steven Allen <[email protected]>
This brings back an old issue #2833
|
We can have the platform do the path conversion for us and store it. I'm not sure if there's a less hacky way to handle it. diff --git a/bin/check_go_path b/bin/check_go_path
index 4f8c0025f..9ddc8f29d 100755
--- a/bin/check_go_path
+++ b/bin/check_go_path
@@ -6,6 +6,14 @@ PKG="$1"
DIR="$(pwd -P)"
GOPATH="$(go env GOPATH)"
+PLATFORM=$(uname -o)
+
+#Win <-> POSIX path conversion
+if [ "$PLATFORM" = "Msys" ] || [ "$PLATFORM" = "Cygwin" ] ; then
+ pushd "$GOPATH"
+ GOPATH="$(pwd -P)"
+ popd
+fi
while read -d ':' p; do
if ! cd "$p/src/$PKG" 2>/dev/null; then |
@djdv That's just a bad error message. In that while loop, it |
@djdv does the latest change fix it on windows? |
@Stebalien
I should mention the patch I supplied, does resolve the issue for me. |
It shouldn't for things like cd, both in
|
Oh. I forgot that windows uses |
The problem with your patch is it won't work if GOPATH has multiple entries (which it technically can). Could you try again? |
With the latest
Ahh yes. I suppose we could do translation inside the loop, for each element in i.e. |
License: MIT Signed-off-by: Steven Allen <[email protected]>
I'm doing that by by cding into the directory in question and using Try again (force pull)? |
@djdv I'm reassigning this to you as this is turning into debug by trial end error. The only requirements are:
|
License: MIT Signed-off-by: Dominic Della Valle <[email protected]>
@Stebalien |
LGTM. @djdv, can you sign off? I can't sign of on my own PR. |
No description provided.