mirror of
https://github.com/TECHNOFAB11/docsonnet.git
synced 2026-02-02 07:35:11 +01:00
feat(eval): handle fully qualified imports
Now also supports github.com/sh0rez/docsonnet/doc-util Fixes #4
This commit is contained in:
parent
2f9dcb2d21
commit
3e1757637e
1 changed files with 9 additions and 2 deletions
|
|
@ -94,10 +94,17 @@ func newImporter(paths []string) (*importer, error) {
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var docUtilPaths = []string{
|
||||||
|
"doc-util/main.libsonnet",
|
||||||
|
"github.com/sh0rez/docsonnet/doc-util/main.libsonnet",
|
||||||
|
}
|
||||||
|
|
||||||
func (i *importer) Import(importedFrom, importedPath string) (contents jsonnet.Contents, foundAt string, err error) {
|
func (i *importer) Import(importedFrom, importedPath string) (contents jsonnet.Contents, foundAt string, err error) {
|
||||||
if importedPath == "doc-util/main.libsonnet" {
|
for _, p := range docUtilPaths {
|
||||||
|
if importedPath == p {
|
||||||
return i.util, "<internal>", nil
|
return i.util, "<internal>", nil
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return i.fi.Import(importedFrom, importedPath)
|
return i.fi.Import(importedFrom, importedPath)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue