RepoForProjectPath creates an ad-hoc drivers.RepoStore for a local project file path
(path string)
| 15 | |
| 16 | // RepoForProjectPath creates an ad-hoc drivers.RepoStore for a local project file path |
| 17 | func RepoForProjectPath(path string) (drivers.RepoStore, string, error) { |
| 18 | instanceID := "default" |
| 19 | repoHandle, err := drivers.Open("file", "", instanceID, map[string]any{"dsn": path}, storage.MustNew(os.TempDir(), nil), activity.NewNoopClient(), zap.NewNop()) |
| 20 | if err != nil { |
| 21 | return nil, "", err |
| 22 | } |
| 23 | repo, _ := repoHandle.AsRepoStore(instanceID) |
| 24 | return repo, instanceID, nil |
| 25 | } |
| 26 | |
| 27 | func HasRillProject(dir string) bool { |
| 28 | repo, _, err := RepoForProjectPath(dir) |
no test coverage detected