summaryrefslogtreecommitdiffstats
path: root/src/config
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2020-12-07 13:23:35 +0100
committerMatthias Beyer <mail@beyermatthias.de>2020-12-07 13:26:16 +0100
commit83b3b97fee854e19c63999e4daadf802784a1499 (patch)
treeaadb169bde50d4497110a7f8989fde755d255c92 /src/config
parent5ff10cdad822300a04ffe3cb2482e20c37d7c2bd (diff)
Implement shebang overwriting
This patch implements the shebang overwriting functionality that was in a TODO note. It adds a `Shebang` type for it, which is a String wrapper. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src/config')
-rw-r--r--src/config/not_validated.rs4
-rw-r--r--src/config/util.rs4
2 files changed, 8 insertions, 0 deletions
diff --git a/src/config/not_validated.rs b/src/config/not_validated.rs
index b827be6..84ad993 100644
--- a/src/config/not_validated.rs
+++ b/src/config/not_validated.rs
@@ -30,6 +30,10 @@ pub struct NotValidatedConfiguration {
#[getset(get = "pub")]
script_highlight_theme: Option<String>,
+ #[serde(default = "default_script_shebang")]
+ #[getset(get = "pub")]
+ shebang: String,
+
#[serde(rename = "releases")]
#[getset(get = "pub")]
releases_directory: PathBuf,
diff --git a/src/config/util.rs b/src/config/util.rs
index ce3836a..424c149 100644
--- a/src/config/util.rs
+++ b/src/config/util.rs
@@ -16,3 +16,7 @@ pub fn default_strict_script_interpolation() -> bool {
true
}
+pub fn default_script_shebang() -> String {
+ String::from("#!/bin/bash")
+}
+