Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
8ae51191
Unverified
Commit
8ae51191
authored
Jul 22, 2018
by
Whyrusleeping
Committed by
GitHub
Jul 22, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5261 from ipfs/fix/5260
fix check_go_path when it has spaces in it
parents
8a299852
7a3566b0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
13 deletions
+24
-13
bin/check_go_path
bin/check_go_path
+23
-12
mk/golang.mk
mk/golang.mk
+1
-1
No files found.
bin/check_go_path
View file @
8ae51191
#!/
bin/
sh
#!/
usr/bin/env ba
sh
PWD
=
$1
set
-e
if
[
-z
"
$PWD
"
]
;
then
echo
"must pass in your current working directory"
exit
1
PKG
=
"
$1
"
DIR
=
"
$(
pwd
-P
)
"
GOPATH
=
"
$(
go
env
GOPATH
)
"
# The path separator is ; on windows.
if
[
"
$(
go
env
GOOS
)
"
=
"windows"
]
;
then
PATHSEP
=
';'
else
PATHSEP
=
':'
fi
while
[
${#}
-gt
1
]
;
do
if
[
"
$PWD
"
=
"
$2
"
]
;
then
exit
0
fi
shift
done
while
read
-r
-d
"
$PATHSEP
"
p
;
do
if
!
cd
"
$p
/src/
$PKG
"
2>/dev/null
;
then
continue
fi
if
[
"
$DIR
"
=
"
$(
pwd
-P
)
"
]
;
then
exit
0
fi
cd
"
$DIR
"
done
<<<
"
$GOPATH$PATHSEP
"
echo
"go-ipfs must be built from within your
\$
GOPATH directory."
echo
"expected within '
$
(
go
env
GOPATH
)
' but got '
$
PWD
'"
echo
"expected within '
$GOPATH
' but got '
$
DIR
'"
exit
1
mk/golang.mk
View file @
8ae51191
...
...
@@ -66,7 +66,7 @@ check_go_version:
DEPS_GO
+=
check_go_version
check_go_path
:
bin/check_go_path
$(
realpath
$(
shell
pwd
))
$(
realpath
$(
addsuffix
/src/github.com/ipfs/go-ipfs,
$(
subst
$(PATH_SEP)
,
$(space)
,
$(GOPATH)
)))
GOPATH
=
"
$(GOPATH)
"
bin/check_go_path github.com/ipfs/go-ipfs
.PHONY
:
check_go_path
DEPS_GO
+=
check_go_path
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment