Skip to content

Commit

Permalink
Update PublishPackageViewModel.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
zeusongit committed May 16, 2024
1 parent e32ec31 commit cccc589
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2649,6 +2649,21 @@ private void PreviewPackageBuild()
return;

var files = GetAllFiles().ToList();
if (!RetainFolderStructureOverride)
{
//Look for duplicate filenames to alert user
var duplicateFiles = files.GroupBy(x => Path.GetFileName(x))
.Where(x => x.Count() > 1)
.ToList();
if (duplicateFiles.Count() > 0)
{
if (!DynamoModel.IsTestMode)
{
MessageBoxService.Show(System.Windows.Application.Current?.MainWindow, string.Format("{0} Duplicate file(s) found.\nFiles with same name will be overwritten in the final package, to avoid it, either rename or discard the duplicate files or enable Retain Folder Structure option.", duplicateFiles.Count()), "Duplicate Files", MessageBoxButton.OK, MessageBoxImage.Warning);
}
}
}

files = files.GroupBy(file => Path.GetFileName(file), StringComparer.OrdinalIgnoreCase)
.Select(group => group.First())
.ToList();
Expand Down

0 comments on commit cccc589

Please sign in to comment.