Skip to content

Commit

Permalink
Merge pull request #499 from bentayloruk/fixprojectfiles-no-op
Browse files Browse the repository at this point in the history
Change RemoveDuplicateFiles & FixMissingFiles to only save on change
  • Loading branch information
forki committed Jul 16, 2014
2 parents ddc9ac1 + 23048f8 commit 2123574
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/app/FakeLib/MSBuild/ProjectSystem.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 2123574

Please sign in to comment.