[debug] now the PowerShell script works (thanks o1-preview and FUCK PowerShell)
This commit is contained in:
parent
b654042d57
commit
70c327ff03
@ -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
|
||||
function Simulate-Input {
|
||||
while ($true) {
|
||||
# Start the process with redirected standard input
|
||||
$processInfo = New-Object System.Diagnostics.ProcessStartInfo
|
||||
$processInfo.FileName = "cargo"
|
||||
$processInfo.Arguments = "run -p lanspread-client -- $args"
|
||||
$processInfo.UseShellExecute = $false
|
||||
$processInfo.RedirectStandardInput = $true
|
||||
|
||||
$process = New-Object System.Diagnostics.Process
|
||||
$process.StartInfo = $processInfo
|
||||
$process.Start() | Out-Null
|
||||
|
||||
# Continuously write commands to the standard input of the process
|
||||
while (!$process.HasExited) {
|
||||
Start-Sleep -Milliseconds 100
|
||||
"list"
|
||||
$process.StandardInput.WriteLine("list")
|
||||
Start-Sleep -Milliseconds 100
|
||||
"get 1"
|
||||
$process.StandardInput.WriteLine("get 1")
|
||||
Start-Sleep -Milliseconds 100
|
||||
"get 25"
|
||||
}
|
||||
$process.StandardInput.WriteLine("get 25")
|
||||
}
|
||||
|
||||
# Run cargo command with piped input from the Simulate-Input function
|
||||
Simulate-Input | cargo run -p lanspread-client -- $args
|
||||
$process.WaitForExit()
|
||||
|
Loading…
Reference in New Issue
Block a user