mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2025-12-11 22:10:09 +01:00
chore: some quality of life changes
This commit is contained in:
parent
5b690ed7ca
commit
5235b29a51
3 changed files with 10 additions and 2 deletions
6
Makefile
6
Makefile
|
|
@ -13,6 +13,12 @@ release-all:
|
||||||
test-rust:
|
test-rust:
|
||||||
cargo test --workspace --verbose
|
cargo test --workspace --verbose
|
||||||
|
|
||||||
|
fmt:
|
||||||
|
cargo fmt
|
||||||
|
|
||||||
|
fix:
|
||||||
|
cargo clippy --all --fix --allow-dirty --allow-staged
|
||||||
|
|
||||||
install:
|
install:
|
||||||
echo "Installing pay-respects core. Use `install-all` to install all modules."
|
echo "Installing pay-respects core. Use `install-all` to install all modules."
|
||||||
cargo install --path core
|
cargo install --path core
|
||||||
|
|
|
||||||
|
|
@ -389,7 +389,8 @@ pub fn module_output(data: &Data, module: &str) -> Option<Vec<String>> {
|
||||||
}
|
}
|
||||||
let break_holder = "<_PR_BR>";
|
let break_holder = "<_PR_BR>";
|
||||||
Some(
|
Some(
|
||||||
String::from_utf8_lossy(&output.stdout)[..output.stdout.len() - break_holder.len()]
|
String::from_utf8_lossy(&output.stdout)
|
||||||
|
.trim_end_matches(break_holder)
|
||||||
.split("<_PR_BR>")
|
.split("<_PR_BR>")
|
||||||
.map(|s| s.trim().to_string())
|
.map(|s| s.trim().to_string())
|
||||||
.collect::<Vec<String>>(),
|
.collect::<Vec<String>>(),
|
||||||
|
|
|
||||||
|
|
@ -38,11 +38,12 @@ Your module should print:
|
||||||
- At the end of each suggestion, append `<_PR_BR>` so pay-respects knows you are either done or adding another suggestion
|
- At the end of each suggestion, append `<_PR_BR>` so pay-respects knows you are either done or adding another suggestion
|
||||||
- **To `stderr`**: Any relevant information that should display to the user (e.g, warning for AI generated content)
|
- **To `stderr`**: Any relevant information that should display to the user (e.g, warning for AI generated content)
|
||||||
|
|
||||||
An example of a shell based module that always adds a `sudo` before the command:
|
An example of a shell based module that always suggest adding a `sudo` or `doas`:
|
||||||
```sh
|
```sh
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
echo "sudo $_PR_LAST_COMMAND"
|
echo "sudo $_PR_LAST_COMMAND"
|
||||||
echo "<_PR_BR>"
|
echo "<_PR_BR>"
|
||||||
|
echo "doas $_PR_LAST_COMMAND"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Adding a Module
|
## Adding a Module
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue