Don't update paths for YQ
ci/woodpecker/push/build Pipeline was successful Details

This commit is contained in:
Nikolai Rodionov 2024-01-16 18:48:34 +01:00
parent c1bc743717
commit cfeadf2d12
Signed by: allanger
GPG Key ID: 0AA46A90E25592AD
1 changed files with 7 additions and 8 deletions

View File

@ -60,16 +60,16 @@ impl Patch {
patch_action.apply(chart_local_path)
}
pub(crate) fn get_path(&self) -> String {
let patch_action = patch_action_from_definition(self.clone()).unwrap();
patch_action.get_path()
match patch_action_from_definition(self.clone()) {
Ok(patch) => patch.get_path(),
Err(_) => "".to_string(),
}
}
pub(crate) fn set_path(&mut self, path: String) {
if let Some(ref mut regexp) = self.regexp {
regexp.path = path;
} else if let Some(ref mut git) = self.git {
git.path = path;
} else if let Some(ref mut yq) = self.yq {
yq.file = path
}
}
@ -148,12 +148,11 @@ impl PatchInterface for YqPatch {
}
fn get_path(&self) -> String {
self.file.clone()
"".to_string()
}
fn set_path(&mut self, new_path: String) {
self.file = new_path
}
fn set_path(&mut self, _new_path: String) {}
}
impl PatchInterface for RegexpPatch {