void DeployFiles(List <string> newStrings, string trimmed)
{
var success = false;
try
{
foreach (var file in Directory.GetFiles(Path.Combine(contentsFinder.ContentFilesPath, "Fody")))
{
File.Copy(file, Path.Combine(trimmed, Path.GetFileName(file)), true);
success = true;
}
var info = string.Format("Fody: Updated '{0}' to version {1}.", trimmed, CurrentVersion.Version);
messageDisplayer.ShowInfo(info);
}
catch (Exception exception)
{
if (success)
{
var error = string.Format("Fody: Failed to update '{0}' to version {1} due to '{2}'. Please manually copy the contents of '{3}' to '{0}'.", trimmed, CurrentVersion.Version, exception.Message, contentsFinder.ContentFilesPath);
messageDisplayer.ShowError(error);
}
else
{
var info = string.Format("Fody: Failed to update '{0}' to version {1} will try again later.", trimmed, CurrentVersion.Version);
messageDisplayer.ShowInfo(info);
newStrings.Add(trimmed);
}
}
}