chore: change to space separated list

This commit is contained in:
iff 2024-12-09 01:30:17 +01:00
parent 039e609aaa
commit 5b521dff09
6 changed files with 6 additions and 5 deletions

View file

@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- **BREAKING:** Executable list passed to modules is now a space ` ` instead of a comma `,`
- Skip privilege elevation for `nix`
## [0.6.1] - 2024-12-09

2
Cargo.lock generated
View file

@ -494,7 +494,7 @@ dependencies = [
[[package]]
name = "pay-respects-module-runtime-rules"
version = "0.1.2"
version = "0.1.3"
dependencies = [
"pay-respects-utils 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"regex-lite",

View file

@ -243,7 +243,7 @@ pub fn module_output(data: &Data, module: &str) -> Option<Vec<String>> {
let executable = &data.split[0];
let last_command = &data.command;
let error_msg = &data.error;
let executables = data.executables.clone().join(",");
let executables = data.executables.clone().join(" ");
let output = std::process::Command::new(shell)
.arg("-c")
.arg(module)

View file

@ -1,6 +1,6 @@
[package]
name = "pay-respects-module-runtime-rules"
version = "0.1.2"
version = "0.1.3"
edition = "2021"
# for crates.io

View file

@ -8,7 +8,7 @@ fn main() -> Result<(), std::io::Error> {
let error_msg = std::env::var("_PR_ERROR_MSG").expect("_PR_ERROR_MSG not set");
let executables: Vec<String> = {
let executables = std::env::var("_PR_EXECUTABLES").expect("_PR_EXECUTABLES not set");
executables.split(",").map(|s| s.to_string()).collect()
executables.split(" ").map(|s| s.to_string()).collect()
};
#[cfg(debug_assertions)]

View file

@ -30,7 +30,7 @@ When running your module, you will get the following environment variables:
- `_PR_COMMAND`: The command, without arguments
- `_PR_LAST_COMMAND`: Full command with arguments
- `_PR_ERROR_MSG`: Error message from the command
- `_PR_EXECUTABLES`: A comma (`,`) separated list of executables in `PATH`
- `_PR_EXECUTABLES`: A space (` `) separated list of executables in `PATH`
Your module should return: