fix: clear stale health notifications
This commit is contained in:
@@ -298,7 +298,11 @@ fn shell_join(parts: &[String]) -> String {
|
||||
|
||||
fn quote_environment(env: &str) -> String {
|
||||
let env = env.replace(['\r', '\n'], " ");
|
||||
if env.is_empty() || env.chars().any(|c| c.is_whitespace() || "\"\\$`".contains(c)) {
|
||||
if env.is_empty()
|
||||
|| env
|
||||
.chars()
|
||||
.any(|c| c.is_whitespace() || "\"\\$`".contains(c))
|
||||
{
|
||||
let escaped = env
|
||||
.replace('\\', "\\\\")
|
||||
.replace('"', "\\\"")
|
||||
@@ -793,7 +797,10 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn quote_environment_quotes_values_with_spaces() {
|
||||
assert_eq!(quote_environment("BITCOIN_RPC_PASS=secret"), "BITCOIN_RPC_PASS=secret");
|
||||
assert_eq!(
|
||||
quote_environment("BITCOIN_RPC_PASS=secret"),
|
||||
"BITCOIN_RPC_PASS=secret"
|
||||
);
|
||||
assert_eq!(
|
||||
quote_environment("RELAY_NAME=Archipelago Nostr Relay"),
|
||||
"\"RELAY_NAME=Archipelago Nostr Relay\""
|
||||
|
||||
Reference in New Issue
Block a user