From 7a8e8ecd650ddb253c08445f6f60686e1c8b8bf5 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 29 Nov 2026 00:50:42 +0000 Subject: config: +raw imports the bytes as they are file+raw:, cmd+raw: and env+raw:, and format = "raw" in a table, give what is there byte for byte (Imported::Raw): no line break removed at its end, and what is no text taken, as a key or a certificate needs. Text and JSON still must be UTF-8, and say +raw where they aren't. A placeholder gives text; in a +raw importer one may be +raw too, and its bytes go in as they are, into a name, a path, an argument or a shell's positional parameter. Into text none does: not into a text or JSON importer, nor into text with placeholders. continuum takes a +raw value as one text, read as nothing else; one that is no UTF-8 it refuses, an option being text. --- src/config/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/config') diff --git a/src/config/mod.rs b/src/config/mod.rs index fd1f8e1..2f67547 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -1788,6 +1788,10 @@ fn from_import(kind: Kind, importer: &import::Importer) -> Result { match importer.fetch()? { Imported::Text(text) => from_text(kind, &text), Imported::Json(value) => Ok(value), + // As it is: one text, its line breaks kept, read as nothing else. + Imported::Raw(bytes) => String::from_utf8(bytes) + .map(JsonValue::String) + .map_err(|_| anyhow!("{} is not UTF-8: an option is text", importer.describe())), } } -- cgit v1.3.1