Use new substitution feature to switch between serial codes
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "psxcdgen_ex"
|
||||
version = "0.2.2"
|
||||
version = "0.2.3"
|
||||
edition = "2021"
|
||||
|
||||
[profile.release]
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tool_helper"
|
||||
version = "0.9.1"
|
||||
version = "0.9.2"
|
||||
edition = "2021"
|
||||
|
||||
[profile.release]
|
||||
|
@@ -213,6 +213,14 @@ pub fn input_to_vec(input: Input) -> Result<Vec<u8>, Error> {
|
||||
}
|
||||
|
||||
pub fn read_file(file_path: &PathBuf) -> Result<Vec<u8>, Error> {
|
||||
if let Some(ext) = file_path.extension() {
|
||||
if ext == "subst" {
|
||||
// File needs substitution!
|
||||
let file_content = read_file_to_string(file_path)?;
|
||||
return Ok(string_with_env_from(&file_content).into_bytes());
|
||||
}
|
||||
}
|
||||
|
||||
match std::fs::read(file_path) {
|
||||
Ok(data) => Ok(data),
|
||||
Err(error) => create_file_read_error(file_path, error),
|
||||
|
Reference in New Issue
Block a user