docs: commit new document
This commit is contained in:
1 parent
20c29ed042
commit
f099042726
3 files changed
+103
-1
No files matched your search
@@ -0,0 +1,21 @@
|
||||
# Command Functions
|
||||
|
||||
> you can use command functions to execute some code & script
|
||||
|
||||
Type Define:
|
||||
```
|
||||
Stdio: "Inhert" | "Piped" | "Null"
|
||||
```
|
||||
|
||||
### `exec(commands: [string], stdout: Stdio, stderr: Stdio)`
|
||||
|
||||
you can use this function to run some command on the current system.
|
||||
|
||||
```lua
|
||||
local cmd = plugin.command
|
||||
|
||||
manager.test = function ()
|
||||
cmd.exec({"git", "clone", "https://github.com/DioxusLabs/cli-plugin-library"})
|
||||
end
|
||||
```
|
||||
> Warning: This function don't have exception catch.
|
||||
Reference in new issue
Block a user