-
Notifications
You must be signed in to change notification settings - Fork 1k
Error handling when running dep init
from project subdirectory
#193
Comments
Hm, that's odd. When you ran |
@sdboyer No. I ran |
I tried this on the subdirectory manifest.json {
"dependencies": {
"github.com/PuerkitoBio/goquery": {
"branch": "master"
},
"github.com/Songmu/timeout": {
"revision": "f7382821bee4009254ba6003475762aa5e740807"
},
"github.com/isucon/isucon6-final": {
"branch": "master"
},
"github.com/mitchellh/go-homedir": {
"branch": "master"
},
"golang.org/x/net": {
"branch": "master"
}
}
} lock.json
|
@catatsuy it's expected that you run
Subsequent commands can be run from anywhere beneath the top-level directory, but the initial run has to be in the directory you want to initialize, or pointing to it. This is also how git works - We might be able to improve error handling around running from a subdirectory, though. |
dep init
from project subdirectory
Improve error messages then a VCS operation fails.
@sdboyer @carolynvs : I'll focus on this issue. |
@wslulciuc Are you still working on this one? |
@carolynvs : Yeah, still plan to patch this, just haven't had the time I'd hoped to focus on this issue. Finally have some free time now, so I'll be visiting this issue later tonight! |
@carolynvs : After further reviewing this issue, I think more details around what specifically we are attempting to resolve is needed. That is, any attempts to determine whether Thoughts? |
I still can't think of any reliable method to detect if we are in the project directory or not.
I think it might be worth it to show a warning when running We can look for signs like a |
@ibrasho : Thanks. That's helpful. What you outlined were possible approaches I was also considering. I'll work on adding them to |
I am hesitant to have init implement heuristics to detect the root of a repo, e.g. checking for To be clear, I don't know if that will 100% work. 😀 Just pointing out another direction that, if we get it to work, would be preferable. |
@carolynvs : I'll explore the possibility of reusing the logic defined in |
@ibrasho I may be missing a lot of context, sorry in advance if my assumptions are way off. Won't doing a check against the depth of the project in the |
@lanzafame nope, you're right - we can't rely on a particular depth within GOPATH. there's no guarantees about that, at all. |
@lanzafame I was just listing possible methods. But, as I said in the original comment, none of my suggestions are definite signs sadly. When keeping in mind that we are trying to print a helpful warning, checking the first segment after |
I tried to adopt
dep
instead of https://github.com/Masterminds/glide in https://github.com/isucon/isucon6-final/tree/master/bench.glide.yml
did not include the own repository (github.com/isucon/isucon6-final
), butmanifest.json
contains the own repository.glide.yml
manifest.json
It is generated by
dep init
on the directory of https://github.com/isucon/isucon6-final/tree/master/bench. I want not to include the own repository likeglide.yml
inmanifest.json
.I use
go version go1.7.3 darwin/amd64
I use macOS Sierra 10.12.2
The text was updated successfully, but these errors were encountered: