homebysix / recipe-robot

A kick ass tool for creating AutoPkg recipes.
Apache License 2.0
300 stars 28 forks source link

2.0.0rc1: Script output in app is not realtime, out of order #170

Closed homebysix closed 3 years ago

homebysix commented 3 years ago

Describe the bug When script output is displayed in the 2.0.0rc1 app, there are two problems:

To Reproduce Steps to reproduce the behavior:

  1. Open Recipe Robot.app version 2.0.0rc1
  2. Provide input in the form of an app, URL, or path
  3. Observe that "Making $appname recipes..." appears but no script output is visible until the script is completely finished.
  4. Observe that warnings and errors appear at the beginning or end of the output, rather than inline with other script output.

Expected behavior Output should be realtime, and should match the behavior of running the recipe-robot command line tool in Terminal.

Screenshots

Screen Shot 2020-10-09 at 9 58 28 AM image

Desktop (please complete the following information):

homebysix commented 3 years ago

The plot thickens. During my testing using curl's --progress-bar output to show file download progress, I discovered that that specific type of output is still shown in real-time in the app:

image

I tried replicating real-time output using sys.stdout.write() and sys.stderr.write() with no luck, but clearly curl is doing something that avoids this issue.

homebysix commented 3 years ago

I found that shelling out to echo seems to work around the issue. I'd like to find a more permanent fix, but that's good enough for now. (https://github.com/homebysix/recipe-robot/commit/eeaa2f91aea4b56aa7147896d1ae9181dbcf2ee1)

homebysix commented 3 years ago

echo workaround included in 2.0.0 release.