refactor(script): rename path to cmd for consistency
BREAKING CHANGE: This changes the option in the `script` module. Any uses of the module must be updated to use the new option name.
This commit is contained in:
@@ -7,7 +7,7 @@ Pango markup is supported.
|
|||||||
|
|
||||||
| Name | Type | Default | Description |
|
| Name | Type | Default | Description |
|
||||||
|------------|-----------------------|---------|---------------------------------------------------------|
|
|------------|-----------------------|---------|---------------------------------------------------------|
|
||||||
| `path` | `string` | `null` | Path to the script on disk |
|
| `cmd` | `string` | `null` | Path to the script on disk |
|
||||||
| `mode` | `'poll'` or `'watch'` | `poll` | See [#modes](#modes) |
|
| `mode` | `'poll'` or `'watch'` | `poll` | See [#modes](#modes) |
|
||||||
| `interval` | `number` | `5000` | Number of milliseconds to wait between executing script |
|
| `interval` | `number` | `5000` | Number of milliseconds to wait between executing script |
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ Pango markup is supported.
|
|||||||
"end": [
|
"end": [
|
||||||
{
|
{
|
||||||
"type": "script",
|
"type": "script",
|
||||||
"path": "/home/jake/.local/bin/phone-battery",
|
"cmd": "/home/jake/.local/bin/phone-battery",
|
||||||
"mode": "poll",
|
"mode": "poll",
|
||||||
"interval": 5000
|
"interval": 5000
|
||||||
}
|
}
|
||||||
@@ -42,7 +42,7 @@ Pango markup is supported.
|
|||||||
```toml
|
```toml
|
||||||
[[end]]
|
[[end]]
|
||||||
type = "script"
|
type = "script"
|
||||||
path = "/home/jake/.local/bin/phone-battery"
|
cmd = "/home/jake/.local/bin/phone-battery"
|
||||||
mode = "poll"
|
mode = "poll"
|
||||||
interval = 5000
|
interval = 5000
|
||||||
```
|
```
|
||||||
@@ -55,7 +55,7 @@ interval = 5000
|
|||||||
```yaml
|
```yaml
|
||||||
end:
|
end:
|
||||||
- type: "script"
|
- type: "script"
|
||||||
path: "/home/jake/.local/bin/phone-battery"
|
cmd: "/home/jake/.local/bin/phone-battery"
|
||||||
mode: 'poll'
|
mode: 'poll'
|
||||||
interval : 5000
|
interval : 5000
|
||||||
```
|
```
|
||||||
@@ -70,7 +70,7 @@ end:
|
|||||||
end = [
|
end = [
|
||||||
{
|
{
|
||||||
type = "script"
|
type = "script"
|
||||||
path = "/home/jake/.local/bin/phone-battery"
|
cmd = "/home/jake/.local/bin/phone-battery"
|
||||||
mode = "poll"
|
mode = "poll"
|
||||||
interval = 5000
|
interval = 5000
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ use tracing::error;
|
|||||||
#[derive(Debug, Deserialize, Clone)]
|
#[derive(Debug, Deserialize, Clone)]
|
||||||
pub struct ScriptModule {
|
pub struct ScriptModule {
|
||||||
/// Path to script to execute.
|
/// Path to script to execute.
|
||||||
path: String,
|
cmd: String,
|
||||||
/// Script execution mode
|
/// Script execution mode
|
||||||
#[serde(default = "default_mode")]
|
#[serde(default = "default_mode")]
|
||||||
mode: ScriptMode,
|
mode: ScriptMode,
|
||||||
@@ -38,7 +38,7 @@ impl From<&ScriptModule> for Script {
|
|||||||
fn from(module: &ScriptModule) -> Self {
|
fn from(module: &ScriptModule) -> Self {
|
||||||
Self {
|
Self {
|
||||||
mode: module.mode,
|
mode: module.mode,
|
||||||
cmd: module.path.clone(),
|
cmd: module.cmd.clone(),
|
||||||
interval: module.interval,
|
interval: module.interval,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user