From 5cc9af23fcd2ca5a51fb961ee6d4525bd8e731fd Mon Sep 17 00:00:00 2001 From: oqyude Date: Mon, 13 Oct 2025 13:05:24 +0300 Subject: [PATCH] eee --- run.ps1 | 6 ++++-- src/vars.ps1 | 31 +++++++++++++++++++++++++------ 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/run.ps1 b/run.ps1 index 374ace3..3972b11 100644 --- a/run.ps1 +++ b/run.ps1 @@ -23,7 +23,7 @@ do { Clear-Host $selectedModule = $moduleNames[$moduleSelection - 1] -$actions = $modules[$selectedModule] +$actions = $modules[$selectedModule].Actions Write-Host "Selected module: $selectedModule" -ForegroundColor Yellow if ($args.Count -ge 1) { @@ -45,4 +45,6 @@ if ($args.Count -ge 1) { Clear-Host Write-Host "Selected action: $action" -ForegroundColor Yellow -& (Get-Variable $selectedModule).Value $action \ No newline at end of file +# & (Get-Variable $selectedModule).Actions $action +$modulePath = $modules[$selectedModule].Path +& $modulePath $action \ No newline at end of file diff --git a/src/vars.ps1 b/src/vars.ps1 index 08708de..8f97298 100644 --- a/src/vars.ps1 +++ b/src/vars.ps1 @@ -8,14 +8,33 @@ $packageManagerModule = "$PSScriptRoot\modules\package-manager.ps1" # Define available modules with their respective actions - need to ref $modules = @{ - "appsDataManagerModule" = @("reconnect", "connect", "disconnect") - "autostartManagerModule" = @("update", "remove") - "deployModule" = @("apply", "clean") - "mountsManagerModule" = @("reconnect", "connect", "disconnect") - "packageManagerModule" = @("install", "uninstall") - "wingetInstallerModule" = @("check", "install") + "AppData Manager" = @{ + Path = $appsDataManagerModule + Actions = @("reconnect", "connect", "disconnect") + } + "Autostart Manager" = @{ + Path = $autostartManagerModule + Actions = @("update", "remove") + } + "Deploy Manager" = @{ + Path = $deployModule + Actions = @("apply", "clean") + } + "Mounts Manager" = @{ + Path = $mountsManagerModule + Actions = @("reconnect", "connect", "disconnect") + } + "Package Manager" = @{ + Path = $packageManagerModule + Actions = @("install", "uninstall") + } + "Winget Installer" = @{ + Path = $wingetInstallerModule + Actions = @("check", "install") + } } + # Functions function checkWingetStatus { try {