fix: initialization_script now read the corresponding file instead of directly executing

This commit is contained in:
Tim-Paik 2022-05-01 00:39:49 +08:00
parent 92206f6ddd
commit a5fe6d8ea9
Signed by: Tim-Paik
GPG Key ID: DC36A050DB42566D
1 changed files with 7 additions and 1 deletions

View File

@ -284,7 +284,13 @@ impl Config {
Some(path) => fs::read_to_string(path.as_path()).ok(),
None => None,
},
initialization_script: self.initialization_script.clone(),
initialization_script: {
if let Some(script_path) = &self.initialization_script {
fs::read_to_string(Path::new(script_path)).ok()
} else {
None
}
},
})
}
}