dagger.#FS support
- Implement dagger.#FS support - Migrate `context.imports` to dagger.#FS - Backward compat: dagger.#FS can be passed in lieu of a dagger.#Artifact - For instance, an import (`dagger.#FS`) can be passed to the current `yarn.#Package` implementation Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
@@ -24,6 +24,10 @@ func NewValue() *Value {
|
||||
return DefaultCompiler.NewValue()
|
||||
}
|
||||
|
||||
func NewValueWithContent(x interface{}, selectors ...cue.Selector) (*Value, error) {
|
||||
return DefaultCompiler.NewValueWithContent(x, selectors...)
|
||||
}
|
||||
|
||||
// FIXME can be refactored away now?
|
||||
func Wrap(v cue.Value) *Value {
|
||||
return DefaultCompiler.Wrap(v)
|
||||
@@ -80,6 +84,14 @@ func (c *Compiler) NewValue() *Value {
|
||||
return empty
|
||||
}
|
||||
|
||||
func (c *Compiler) NewValueWithContent(x interface{}, selectors ...cue.Selector) (*Value, error) {
|
||||
v := c.NewValue()
|
||||
if err := v.FillPath(cue.MakePath(selectors...), x); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return v, nil
|
||||
}
|
||||
|
||||
func (c *Compiler) Compile(name string, src string) (*Value, error) {
|
||||
c.lock()
|
||||
defer c.unlock()
|
||||
|
Reference in New Issue
Block a user