Call `resolve_paths` in slightly fewer cases

This commit is contained in:
Robin Avery 2024-03-01 14:01:21 -05:00
parent 834ba3d3af
commit 788ece1fdb
No known key found for this signature in database
GPG Key ID: 633B2D5AB640375C
1 changed files with 3 additions and 2 deletions

View File

@ -78,9 +78,8 @@ pub fn run(args: Args) -> Result<()> {
PathBuf::from_str(u).ok().and_then(|p| fs::canonicalize(p).ok());
let Some(object) = project_config.objects.iter_mut().find_map(|obj| {
resolve_paths(obj);
if obj.name.as_deref() == Some(u) {
resolve_paths(obj);
return Some(obj);
}
@ -88,6 +87,8 @@ pub fn run(args: Args) -> Result<()> {
return None;
};
resolve_paths(obj);
if [&obj.base_path, &obj.target_path]
.into_iter()
.filter_map(|p| p.as_ref().and_then(|p| p.canonicalize().ok()))