rework to have only 1 exe!

This commit is contained in:
Alex Bezdieniezhnykh
2024-12-04 20:51:26 +02:00
parent 3944df8efe
commit 60519461a1
25 changed files with 194 additions and 198 deletions
+6 -6
View File
@@ -8,7 +8,7 @@ namespace Azaion.Common.Services;
public interface IHardwareService
{
Task<HardwareInfo> GetHardware();
HardwareInfo GetHardware();
}
public class HardwareService : IHardwareService
@@ -23,11 +23,11 @@ public class HardwareService : IHardwareService
"lscpu | grep 'Model name:' | cut -d':' -f2 && " +
"lspci | grep VGA | cut -d':' -f3\"";
public async Task<HardwareInfo> GetHardware()
public HardwareInfo GetHardware()
{
try
{
var output = await RunCommand(Environment.OSVersion.Platform == PlatformID.Win32NT
var output = RunCommand(Environment.OSVersion.Platform == PlatformID.Win32NT
? WIN32_GET_HARDWARE_COMMAND
: UNIX_GET_HARDWARE_COMMAND);
@@ -77,7 +77,7 @@ public class HardwareService : IHardwareService
return macAddress ?? string.Empty;
}
private async Task<string> RunCommand(string command)
private string RunCommand(string command)
{
try
{
@@ -91,8 +91,8 @@ public class HardwareService : IHardwareService
process.StartInfo.CreateNoWindow = true;
process.Start();
var result = await process.StandardOutput.ReadToEndAsync();
await process.WaitForExitAsync();
var result = process.StandardOutput.ReadToEnd();
process.WaitForExit();
return result.Trim();
}