Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change RemoveDuplicateFiles & FixMissingFiles to only save on change #499

Merged
merged 1 commit into from
Jul 16, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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