cobra init --help lists possible combinations including no name.
It seems that all other combinations except cobra init name, fail.
For example:
[user@host cobra_project]$ cobra init
Error: Rel: can't make /home/user/ws/testws-2/go/cobra_project relative to
[user@host cobra_project]$ cobra init $(pwd)
Error: Rel: can't make /home/user/ws/testws-2/go/cobra_project relative to
[user@host cobra_project]$ cobra init $(pwd)/test
Error: can't read path info: lstat /home/user/ws/testws-2/go/cobra_project/test: no such file or directory
With a name provided, it works, as expected:
[user@host cobra_project]$ cobra init cobra_project
Your Cobra application is ready at
/home/user/ws/testws-2/go/cobra_project/src/cobra_project.
Give it a try by going there and running `go run main.go`.
Add commands to it by running `cobra add [cmdname]`.
$GOPATH is set to: /home/user/ws/testws-2/go/cobra_project/
host is Fedora 27
Same issue for me.
Same issue for me.
Any plans on addressing this issue or should it be closed and we can work around it?
I had the same issue and it was caused by me having symlinks in my project directory. You can do
cd `pwd -P`
to resolve all symlinks and then do cobra add|init ...
I'd say that this PR does not apply anymore, because of #817 (see also #904). @galileo-pkm, @dbrimley, @XiaoyeFang, @jmvbxx, could try the latest master?
@dimitarvdimitrov, could you please provide some context? Which is the structure of the directory where you did need to execute pwd -P for cobra init to work?
@jharshman, should this be closed?
Most helpful comment
Same issue for me.