Created
October 4, 2021 22:45
-
-
Save pdcastro/6cb935b152ad18e6f459cf8723b8c315 to your computer and use it in GitHub Desktop.
Extract 'REMOTE_EXIT_CODE=' from stdin and pass the rest through
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import fileinput, sys | |
exitCode = 0 | |
for line in fileinput.input(): | |
if line.startswith('REMOTE_EXIT_CODE='): | |
exitCode = int(line.split(sep='=', maxsplit=1)[1]) | |
else: | |
print(line, end='') | |
sys.exit(exitCode) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage and context provided in this comment: balena-io/balena-cli#1535 (comment)