DX: change "#dagger: compute: " to "#compute: "

Signed-off-by: Solomon Hykes <sh.github.6811@hykes.org>
This commit is contained in:
Solomon Hykes
2021-02-12 23:22:41 +00:00
parent 3f445f2421
commit 7a77466a66
81 changed files with 176 additions and 229 deletions

View File

@@ -8,13 +8,13 @@ import (
func TestLocalDirs(t *testing.T) {
env := mkEnv(t,
`#dagger: compute: [
`#compute: [
{
do: "local"
dir: "bar"
}
]`,
`dir: #dagger: compute: [
`dir: #compute: [
{
do: "local"
dir: "foo"

View File

@@ -149,7 +149,7 @@ func (env *Env) LocalDirs() map[string]string {
flow := cueflow.New(&cueflow.Config{}, inst, newDummyTaskFunc(inst))
for _, t := range flow.Tasks() {
v := compiler.Wrap(t.Value(), inst)
localdirs(v.Get("#dagger.compute"))
localdirs(v.Get("#compute"))
}
// 2. Scan the environment updater
localdirs(env.Updater())

View File

@@ -102,7 +102,7 @@ func (f dirFlag) Set(s string) error {
return nil, err
}
return compiler.Compile("", fmt.Sprintf(
`#dagger: compute: [{do:"local",dir:"%s", include:%s}]`,
`#compute: [{do:"local",dir:"%s", include:%s}]`,
s,
include,
))
@@ -140,7 +140,7 @@ func (f gitFlag) Set(s string) error {
remote := u.String()
return compiler.Compile("", fmt.Sprintf(
`#dagger: compute: [{do:"fetch-git", remote:"%s", ref:"%s"}]`,
`#compute: [{do:"fetch-git", remote:"%s", ref:"%s"}]`,
remote,
ref,
))

View File

@@ -41,7 +41,7 @@ func (p *Pipeline) FS() FS {
}
func isComponent(v *compiler.Value) bool {
return v.Get("#dagger.compute").Exists()
return v.Get("#compute").Exists()
}
func ops(code ...*compiler.Value) ([]*compiler.Value, error) {
@@ -50,7 +50,7 @@ func ops(code ...*compiler.Value) ([]*compiler.Value, error) {
for _, x := range code {
// 1. attachment array
if isComponent(x) {
xops, err := x.Get("#dagger.compute").List()
xops, err := x.Get("#compute").List()
if err != nil {
return nil, err
}