You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried several attempts to capture scoop output with no success. I've tried several approaches outlined below.
Currently, the only solution that works for capturing the raw output is by running Scoop commands with cmd /c <command> 2>&1, which is not a pretty solution and doesn't output colors or print to the console until the command finishes.
Redirecting the script's stdout & stderr to both the terminal and a variable (or a temp file, whichever is preferable) that can be parsed for more information, would be really helpful. For this case in this project, the only script I've added for now is an auto-updater, which would spawn a new Powershell window running the scoop update * command. The problem is that the update process needs to be transparent to the user: when it has started, the update process itself, and what errors occurred for some packages to fail to update.
Steps taken:
Tried using Invoke-Expression to capture Scoop output
Tried piping to Tee-Object and Out-String to capture Scoop output
Tried using the $strHwid variable to capture Scoop output, but it only works for Windows executables
Checked the Scoop documentation for information on capturing output, but did not find anything
Current workaround:
Running Scoop commands with cmd /c 2>&1 to capture the raw output
The current autoupdate scripts does add a bit of transparency with the recent changes by properly reflecting the end result of the upate process, as well as numbers to help identify the error that has occurred.
As you can see, it is not perfect. The output in stdout is completely stripped of colors, and it does not stream the output as it would normally.
The text was updated successfully, but these errors were encountered:
I've tried several attempts to capture scoop output with no success. I've tried several approaches outlined below.
Currently, the only solution that works for capturing the raw output is by running Scoop commands with
cmd /c <command> 2>&1
, which is not a pretty solution and doesn't output colors or print to the console until the command finishes.Redirecting the script's stdout & stderr to both the terminal and a variable (or a temp file, whichever is preferable) that can be parsed for more information, would be really helpful. For this case in this project, the only script I've added for now is an auto-updater, which would spawn a new Powershell window running the
scoop update *
command. The problem is that the update process needs to be transparent to the user: when it has started, the update process itself, and what errors occurred for some packages to fail to update.Steps taken:
Current workaround:
The current autoupdate scripts does add a bit of transparency with the recent changes by properly reflecting the end result of the upate process, as well as numbers to help identify the error that has occurred.
As you can see, it is not perfect. The output in stdout is completely stripped of colors, and it does not stream the output as it would normally.
The text was updated successfully, but these errors were encountered: