robfig / glock

MIT License
230 stars 27 forks source link

glock save on new repo fails to open GLOCKFILE #7

Closed joeshaw closed 10 years ago

joeshaw commented 10 years ago

I decided to go with a fresh checkout for the new command stuff:

$ glock save github.com/joeshaw/envdecode
open /Users/joeshaw/go/src/github.com/joeshaw/envdecode/GLOCKFILE: no such file or directory

If I touched GLOCKFILE before I ran, things worked fine.

(As an aside, it would be nice to run glock save . or glock save ./...)

robfig commented 10 years ago

Whoops, I think I was too eager to push it out. I've just pulled back the commit -- the fix for this particular problem is easy, but I also realized that "glock cmd" will not add all of the cmd dependencies.

Sorry for the false alarm. I'll finish it up, w/ a better job testing, over the weekend

joeshaw commented 10 years ago

yep, I just noticed the tool dependency thing as well. Thanks for taking a look into it, it is otherwise working well for me.

joliver commented 10 years ago

Plus 1 on glock save . vs glock save ./...

robfig commented 10 years ago

OK, I just pushed another attempt at "glock cmd" functionality. It seems to work well. Please let me know if you find anything amiss!

Thanks for your help btw

joeshaw commented 10 years ago

@robfig Working great, thanks a lot. Now, to switch all my projects over to it :smile:

dmitshur commented 10 years ago

Now, to switch all my projects over to it

Is there an existing way to automatically import similar files (e.g., Godeps) and convert to glock's format?

robfig commented 10 years ago

Nothing official; probably I should add a section in the README for that. I think it should be easy:

  1. Get your workspace into a state you want to save (e.g. using godeps restore, or whatever)
  2. "glock save path/to/project"

If you're using godeps copy=false it should just work. If you use godeps with vendoring, then you may have to set the GOPATH so that glock can find the dependencies, eg.

GOPATH=$GOPATH:pwd/_vendor glock save path/to/project

However, I have not tested glock with multiple GOPATHs. If that doesn't work, then I would be willing to fix it. A workaround would be to copy your project into your vendor GOPATH and then use

GOPATH=pwd/_vendor glock save path/to/project

and take the resulting GLOCKFILE