1
0
Fork 0

Some reworks for stuff

This commit is contained in:
Booklordofthedings 2025-04-09 16:36:54 +02:00
parent ed4e813881
commit 8e8fdd9a0b
5 changed files with 87 additions and 19 deletions

15
package.list Normal file
View file

@ -0,0 +1,15 @@
nano
wine
wine64
build-essential
git
remmina
mesa-vulkan-drivers
libglx-mesa0:i386
mesa-vulkan-drivers:i386
libgl1-mesa-dri:i386
dconf-editor
beefbuild
audacity
npm
neofetch

22
src/PackageInstaller.cs Normal file
View file

@ -0,0 +1,22 @@
namespace Setup_Workspace;
public class PackageInstaller : Doable
{
/*
* Install packages from a package list file
* This uses apt by default
*/
public override async Task<bool> Do()
{
Console.WriteLine("Installing packages...");
var packages = File.ReadAllText("package.list");
packages = packages.Replace("\n", " ");
Helper.RunCommand("apt install", $"{packages} -y");
Console.WriteLine("Installed packages");
return true;
}
}

View file

@ -1,16 +0,0 @@
namespace Setup_Workspace;
public class Packages
{
public void InstallPackages()
{
/*
read list of packages from file
to install
to remove
to install from never
install from other sources
*/
}
}

View file

@ -10,8 +10,21 @@ Console.WriteLine("""
"""); """);
Console.Write(">"); Console.Write(">");
Console.ReadLine(); var input = Console.ReadLine();
Helper.RunCommand("apt", "update");
switch (input)
{
case "full-install":
new Runner().Then(
new PackageInstaller()
).Run();
break;
case "exit":
break;
default:
Console.WriteLine("Please enter a valid input");
break;
}

34
src/Runner.cs Normal file
View file

@ -0,0 +1,34 @@
namespace Setup_Workspace;
public class Runner : Doable
{
public override Task<bool> Do()
{
Console.WriteLine("Running tasks");
return Task.FromResult(true);
}
}
public abstract class Doable
{
public abstract Task<bool> Do();
public List<Doable> Followup = new List<Doable>();
public Doable Then(params Doable[] doables)
{
foreach (var entry in doables)
Followup.Add(entry);
return this;
}
public async Task Run()
{
if (!await Do())
return;
foreach (var entry in Followup)
entry.Run();
}
}