(includableRef, workingDir string)
| 17 | } |
| 18 | |
| 19 | func parseIncludable(includableRef, workingDir string) (Includable, error) { |
| 20 | ref, err := flake.ParseRef(includableRef) |
| 21 | if err != nil { |
| 22 | return nil, err |
| 23 | } |
| 24 | switch ref.Type { |
| 25 | case flake.TypePath: |
| 26 | return newLocalPlugin(ref, workingDir) |
| 27 | case flake.TypeGitHub: |
| 28 | return newGithubPlugin(ref) |
| 29 | case flake.TypeGit: |
| 30 | return newGitPlugin(ref) |
| 31 | default: |
| 32 | return nil, fmt.Errorf("unsupported ref type %q", ref.Type) |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | type fetcher interface { |
| 37 | Includable |
no test coverage detected