-
Notifications
You must be signed in to change notification settings - Fork 60
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
file:
URLs aren't supported
#50
Comments
I have an idea of what the problem is. remote := "file:///Users/pburkholder/tmp/vcs" // panics
local, _ := ioutil.TempDir("", "go-vcs")
fmt.Println(local)
repo, _ := vcs.NewRepo(remote, local)
// Returns: instance of GitRepo
repo.Vcs() This last line is line 18 in your snippet which is where the nil panic happens. An error was returned.
There are two options here. First, if you know it's git you can use If you have a good suggestion on detecting the type from a file path, such as your example, i'd be interested in hearing it or reviewing a pull request. |
@sdboyer I'm considering adding auto-detection for |
@mattfarina i don't think it would directly impact, because gps has its own multi-layered logic that receives input paths and decides how to actually source them in. i do still need to implement analogous logic for this, though, in order to get that mirrors support in. So even if gps doesn't use this directly, i'll do a "little bit of copying" and take advantage of it :) |
reflecting a little more, i'm sure it would be possible to write a func that, given a it might only be useful, though, if it's fully separated from |
@mattfarina is there a way to easily detect the current folder as a remote? |
PR in #58. Release coming soon. |
Closes #50: Auto-detect remotes with file:// prefix.
Maybe I'm doing it wrong, but I expected something like this to work:
but I get
For a downstream project I'd find it useful to reference repositories by local filesystem paths, so that this package works similarly to:
Thanks, Peter
The text was updated successfully, but these errors were encountered: