Skip to content
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

cobra init only works with name #652

Closed
galileo-pkm opened this issue Mar 21, 2018 · 6 comments
Closed

cobra init only works with name #652

galileo-pkm opened this issue Mar 21, 2018 · 6 comments

Comments

@galileo-pkm
Copy link

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

@dbrimley
Copy link

Same issue for me.

1 similar comment
@XiaoyeFang
Copy link

Same issue for me.

@jmvbxx
Copy link

jmvbxx commented Dec 31, 2018

Any plans on addressing this issue or should it be closed and we can work around it?

@dimitarvdimitrov
Copy link

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 ...

@umarcor
Copy link
Contributor

umarcor commented Jul 23, 2019

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?

@umarcor
Copy link
Contributor

umarcor commented Jul 30, 2019

@jharshman, should this be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants