Install commands, improvements

This commit is contained in:
2022-11-06 18:36:04 +01:00
parent 8fd6b526f8
commit 30c3266e25
15 changed files with 278 additions and 87 deletions

View File

@@ -5,10 +5,13 @@ public class ModuleConfiguration
public string? Target { get; set; }
public Dictionary<string, string>? Links { get; set; }
public ModuleConfiguration(string? target, Dictionary<string, string>? links)
public string? Install { get; set; }
public ModuleConfiguration(string? target, Dictionary<string, string>? links, string? install)
{
Target = target;
Links = links;
Install = install;
}
public ModuleConfiguration Merge(ModuleConfiguration merge)
@@ -17,10 +20,11 @@ public class ModuleConfiguration
.Concat(merge.Links ?? new Dictionary<string, string>());
return new ModuleConfiguration(
merge.Target ?? Target,
new Dictionary<string, string>(mergedLinks)
new Dictionary<string, string>(mergedLinks),
merge.Install ?? Install
);
}
public static ModuleConfiguration Empty() =>
new(null, new Dictionary<string, string>());
new(null, new Dictionary<string, string>(), null);
}

View File

@@ -2,6 +2,6 @@ namespace Alma.Services;
public interface IOsInformation
{
string GetOsIdentifier();
bool IsOnPlatform(string platform);
Task<string> GetOsIdentifierAsync();
Task<bool> IsOnPlatformAsync(string platform);
}

View File

@@ -0,0 +1,6 @@
namespace Alma.Services;
public interface IShellService
{
Task RunCommandAsync(string command);
}