Skip to content

Commit

Permalink
Clean up with latest C# features
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyrrrz committed Jan 11, 2024
1 parent b191c6a commit ecd7b7f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,5 @@

namespace DotnetRuntimeBootstrapper.AppHost.Core;

public class BootstrapperException : Exception
{
public BootstrapperException(string message, Exception? innerException = null)
: base(message, innerException) { }
}
public class BootstrapperException(string message, Exception? innerException = null)
: Exception(message, innerException);
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ public static IEnumerable<string> GetInstalledUpdates()
}
}

public static void Reboot() => CommandLine.Run("shutdown", new[] { "/r", "/t", "0" });
public static void Reboot() => CommandLine.Run("shutdown", ["/r", "/t", "0"]);
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ public PrerequisiteInstallerResult Run()
{
try
{
var exitCode = CommandLine.Run(
FilePath,
new[] { "/install", "/quiet", "/norestart" },
true
);
var exitCode = CommandLine.Run(FilePath, ["/install", "/quiet", "/norestart"], true);

// https://github.com/Tyrrrz/DotnetRuntimeBootstrapper/issues/24#issuecomment-1021447102
if (exitCode is 3010 or 3011 or 1641)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ public PrerequisiteInstallerResult Run()
{
try
{
var exitCode = CommandLine.Run(
"wusa",
new[] { FilePath, "/quiet", "/norestart" },
true
);
var exitCode = CommandLine.Run("wusa", [FilePath, "/quiet", "/norestart"], true);

// https://github.com/Tyrrrz/DotnetRuntimeBootstrapper/issues/24#issuecomment-1021447102
if (exitCode is 3010 or 3011 or 1641)
Expand Down

0 comments on commit ecd7b7f

Please sign in to comment.