[debug] now the PowerShell script works (thanks o1-preview and FUCK PowerShell)

This commit is contained in:
ddidderr 2024-11-08 23:23:38 +01:00
parent b654042d57
commit 70c327ff03
Signed by: ddidderr
GPG Key ID: 3841F1C27E6F0E14

View File

@ -1,17 +1,24 @@
# Set environment variable $Env:RUST_LOG = "info,lanspread_client=debug,lanspread_proto=debug"
$env:RUST_LOG = "info,lanspread_client=debug,lanspread_proto=debug"
# Define a function to simulate the input sequence # Start the process with redirected standard input
function Simulate-Input { $processInfo = New-Object System.Diagnostics.ProcessStartInfo
while ($true) { $processInfo.FileName = "cargo"
Start-Sleep -Milliseconds 100 $processInfo.Arguments = "run -p lanspread-client -- $args"
"list" $processInfo.UseShellExecute = $false
Start-Sleep -Milliseconds 100 $processInfo.RedirectStandardInput = $true
"get 1"
Start-Sleep -Milliseconds 100 $process = New-Object System.Diagnostics.Process
"get 25" $process.StartInfo = $processInfo
} $process.Start() | Out-Null
# Continuously write commands to the standard input of the process
while (!$process.HasExited) {
Start-Sleep -Milliseconds 100
$process.StandardInput.WriteLine("list")
Start-Sleep -Milliseconds 100
$process.StandardInput.WriteLine("get 1")
Start-Sleep -Milliseconds 100
$process.StandardInput.WriteLine("get 25")
} }
# Run cargo command with piped input from the Simulate-Input function $process.WaitForExit()
Simulate-Input | cargo run -p lanspread-client -- $args