-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Description
Describe the feature
export default defineCommand({
meta: {
name: 'test',
description: 'Test command',
},
async setup(context) {
const data = someComputed(context)
return { data }
},
async run({ args }, { data }) {
console.log(data)
}
})Reason
The return value of setup could be useful, in addition to some initialization behavior, it could potentially produce different values depending on the context, which could be used in setup and passed to all subcommands in the run method arguments!
Of course, I may not have thought this through completely, does anyone else have a better suggestion?
Additional information
- Would you be willing to help implement this feature?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels