Transofrmation

This commit is contained in:
2025-08-12 19:04:09 +02:00
parent 9e4141fc96
commit ddba3423df
3 changed files with 15 additions and 3 deletions

View File

@@ -125,9 +125,20 @@ impl MetaRules {
println!("[INFO] Applying rule {}", rule.0);
let base_pattern: Regex = Regex::new((rule.1 .0).as_str()).unwrap();
let processed_code_replacement = processed_code.clone();
let parameter = &base_pattern
let parameter = if &base_pattern
.captures(processed_code_replacement.as_str())
.unwrap()[0];
.unwrap()
.len()
> 0
{
&base_pattern
.captures(processed_code_replacement.as_str())
.unwrap()[0]
} else {
&base_pattern
.captures(processed_code_replacement.as_str())
.unwrap()
};
let command: &str = &base_pattern.replace(parameter, rule.1 .1.as_str());
println!("{:?}", &command);
let subprocess = std::process::Command::new("/bin/bash")