Skip to content

Commit

Permalink
Rollback File format
Browse files Browse the repository at this point in the history
  • Loading branch information
ricaun committed Mar 14, 2024
1 parent f3b8abe commit 275499a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions source/Nuke.Tooling/SettingsEntity.NewInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
// Distributed under the MIT License.
// https://github.com/nuke-build/nuke/blob/master/LICENSE

using JetBrains.Annotations;
using System;
using System.IO;
using System.Linq;
using System.Runtime.Serialization.Formatters.Binary;
using JetBrains.Annotations;
#pragma warning disable SYSLIB0011

namespace Nuke.Common.Tooling;
Expand All @@ -25,12 +25,12 @@ public static T NewInstance<T>(this T settingsEntity)
binaryFormatter.Serialize(memoryStream, settingsEntity);
memoryStream.Seek(offset: 0, loc: SeekOrigin.Begin);

var newInstance = (T)binaryFormatter.Deserialize(memoryStream);
var newInstance = (T) binaryFormatter.Deserialize(memoryStream);
if (newInstance is ToolSettings toolSettings)
{
toolSettings.ProcessArgumentConfigurator = ((ToolSettings)(object)settingsEntity).ProcessArgumentConfigurator;
toolSettings.ProcessLogger = ((ToolSettings)(object)settingsEntity).ProcessLogger;
toolSettings.ProcessExitHandler = ((ToolSettings)(object)settingsEntity).ProcessExitHandler;
toolSettings.ProcessArgumentConfigurator = ((ToolSettings) (object) settingsEntity).ProcessArgumentConfigurator;
toolSettings.ProcessLogger = ((ToolSettings) (object) settingsEntity).ProcessLogger;
toolSettings.ProcessExitHandler = ((ToolSettings) (object) settingsEntity).ProcessExitHandler;
}

return newInstance;
Expand Down

0 comments on commit 275499a

Please sign in to comment.