Skip to content

Commit

Permalink
Shell out to echo instead of printing, if NSUnbufferedIO env var is set
Browse files Browse the repository at this point in the history
  • Loading branch information
homebysix committed Nov 1, 2020
1 parent 6d122f3 commit eeaa2f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ All notable changes to this project will be documented in this file. This projec

### Known Issues
- On macOS 10.14 (and possibly earlier) an incorrect "certificate has expired" warning may appear in the output. (#165)
- Script output does not appear in the app until the script is completely done processing. I hope to restore realtime output in a later version.
- The "jss-upload" type is not addressable yet in the Recipe Robot app, only in the script.
- Because Recipe Robot is now using plistlib instead of FoundationPlist, it's likely that some non-standard developer plist files may not successfully parse. This is because plistlib is stricter than FoundationPlist, and the same issue applies to AutoPkg itself (see [autopkg#618](https://github.com/autopkg/autopkg/issues/618) for an example).

Expand Down
5 changes: 4 additions & 1 deletion scripts/recipe_robot_lib/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,10 @@ def robo_print(message, log_level=LogLevel.LOG, indent=0):
and (OutputMode.verbose_mode or OutputMode.debug_mode)
)
):
if log_level in (LogLevel.ERROR, LogLevel.WARNING):
if os.environ.get("NSUnbufferedIO") == "YES":
# Shell out to enable realtime output in Recipe Robot app.
subprocess.run(["echo", line])
elif log_level in (LogLevel.ERROR, LogLevel.WARNING):
print(line, file=sys.stderr)
else:
print(line)
Expand Down

0 comments on commit eeaa2f9

Please sign in to comment.