sheepit/flamenco toggle
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using UnifiedFarmLauncher.Models;
|
||||
|
||||
@@ -20,7 +21,7 @@ namespace UnifiedFarmLauncher.Services
|
||||
await _controllerService.DeployAttachHelperAsync(worker);
|
||||
|
||||
var remoteBasePath = await _sshService.GetWorkerBasePathAsync(worker);
|
||||
var remoteHelper = $"{remoteBasePath.Replace("\\", "/")}/attach-helper.ps1";
|
||||
var remoteHelper = Path.Combine(remoteBasePath, "attach-helper.ps1");
|
||||
|
||||
var paramsBlock = $"-WorkerName \"{worker.Name}\" -WorkerType \"{workerType}\"";
|
||||
if (commandOnly)
|
||||
@@ -32,7 +33,9 @@ namespace UnifiedFarmLauncher.Services
|
||||
paramsBlock += $" -Command \"{command}\"";
|
||||
}
|
||||
|
||||
var remoteCmd = $"powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -File \"{remoteHelper}\" {paramsBlock}";
|
||||
// Use Windows path format (backslashes) and ensure it's properly quoted
|
||||
// Add -NoExit to keep window open and ensure output is visible
|
||||
var remoteCmd = $"powershell.exe -NoLogo -NoProfile -NoExit -ExecutionPolicy Bypass -File \"{remoteHelper}\" {paramsBlock}";
|
||||
|
||||
_sshService.StartInteractiveSsh(worker, remoteCmd);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user