diff --git a/deps/buildcore/scripts/pybb.py b/deps/buildcore/scripts/pybb.py index 16d0b05a..76bc44b9 100755 --- a/deps/buildcore/scripts/pybb.py +++ b/deps/buildcore/scripts/pybb.py @@ -8,7 +8,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -# "Python Busy Box" - adds cross platform equivalents to Unix commands that +# "Python Busy Box" - adds cross-platform equivalents to Unix commands that # don't translate well to that other operating system import os @@ -17,7 +17,7 @@ import subprocess import sys -def cat(paths: str) -> int: +def cat(paths: [str]) -> int: for path in paths: try: with open(path) as f: @@ -109,11 +109,15 @@ def main(): err = cmake_build(sys.argv[2], sys.argv[3] if len(sys.argv) > 3 else None) elif sys.argv[1] == 'cat': err = cat(sys.argv[2:]) - sys.exit(err) + else: + sys.stderr.write('Command not found\n') + err = 1 + return err if __name__ == '__main__': try: - main() + err = main() + sys.exit(err) except KeyboardInterrupt: sys.exit(1)