Don't update paths for YQ

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

View File

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