From 23048f884639635058b63ceab9f92a23d32e9f31 Mon Sep 17 00:00:00 2001 From: Ben Taylor Date: Fri, 11 Jul 2014 22:51:34 +0100 Subject: [PATCH] Change RemoveDuplicateFiles and FixMissingFiles to save the their newProject instances only when there are actually changes (prevents project file modified datetime change and reload in editor). --- src/app/FakeLib/MSBuild/ProjectSystem.fs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/app/FakeLib/MSBuild/ProjectSystem.fs b/src/app/FakeLib/MSBuild/ProjectSystem.fs index 89788d68d22..9cc2e312f78 100644 --- a/src/app/FakeLib/MSBuild/ProjectSystem.fs +++ b/src/app/FakeLib/MSBuild/ProjectSystem.fs @@ -123,16 +123,18 @@ let FixMissingFiles templateProject projects = findMissingFiles templateProject projects |> Seq.iter (fun pc -> let project = ProjectFile.FromFile pc.ProjectFileName - let newProject = Seq.fold addMissing project pc.MissingFiles - newProject.Save()) + if not (Seq.isEmpty pc.MissingFiles) then + let newProject = Seq.fold addMissing project pc.MissingFiles + newProject.Save()) /// It removes duplicate files from the project files. let RemoveDuplicateFiles projects = projects |> Seq.iter (fun fileName -> let project = ProjectFile.FromFile fileName - let newProject = project.RemoveDuplicates() - newProject.Save()) + if not (project.FindDuplicateFiles().IsEmpty) then + let newProject = project.RemoveDuplicates() + newProject.Save()) /// Compares the given projects to the template project and adds all missing files to the projects if needed. /// It also removes duplicate files from the project files.