-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(lesy-plugin-demo): add input command
- Loading branch information
1 parent
3ddad9d
commit 829d658
Showing
4 changed files
with
273 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
packages/plugins/lesy-plugin-demo/src/commands/input.command.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export default { | ||
name: "dummyInput", | ||
description: `simple text input command`, | ||
aliases: ["di", "inp"], | ||
group: "Demo", | ||
run: async ({ feature }) => { | ||
console.log("feat", feature); | ||
const answers = await feature.prompt([ | ||
{ | ||
name: "dummy-input", | ||
message: "Type something", | ||
type: "input", | ||
}, | ||
]); | ||
console.log(`you typed: ${answers["dummy-input"]}`); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export default { | ||
commands: [`${__dirname}/commands`], | ||
plugins: ["@lesy/lesy-plugin-prompt"], | ||
}; |