Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

command "dump" is not defined when running cue dump ./... #1077

Closed
yujunz opened this issue Jul 2, 2021 · 2 comments
Closed

command "dump" is not defined when running cue dump ./... #1077

yujunz opened this issue Jul 2, 2021 · 2 comments

Comments

@yujunz
Copy link
Contributor

yujunz commented Jul 2, 2021

What version of CUE are you using (cue version)?

$ cue version
cue version 0.4.0 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What did you do?

❯ cue help cmd
...
Available Commands:
  dump
...

❯ cue dump ./...

What did you expect to see?

Run the specified command

What did you see instead?

❯ cue dump ./...
command "dump" is not defined
Ensure commands are defined in a "_tool.cue" file.
Run 'cue help' to show available commands.

While dumping each directory all works

❯ tree .
.
├── app
│   └── app.cue
├── app.cue
└── dump_tool.cue

❯ cue dump .
name: root

❯ cue dump ./app
name: app

Test case: test.tar.gz

@yujunz
Copy link
Contributor Author

yujunz commented Jul 2, 2021


❯ cat app.cue
package test

application: [Name=_]: {
	name: Name
}

releases: [
	for k, x in application {
		name: k
	},
]

application: root: _

❯ cat dump_tool.cue
package test

import (
	"encoding/yaml"
)

command: dump: {
	task: print: {
		kind: "print"
		text: yaml.MarshalStream(releases)
	}
}

for rls in releases {
	command: "dump-\(rls.name)": {
		task: print: {
			kind: "print"
			text: rls
		}
	}
}

❯ cat app/app.cue
package test

application: app: _

@cueckoo
Copy link

cueckoo commented Jul 3, 2021

This issue has been migrated to cue-lang/cue#1077.

For more details about CUE's migration to a new home, please see cue-lang/cue#1078.

@cueckoo cueckoo closed this as completed Jul 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants