Skip to content

Commit 7e30729

Browse files
committed
show build details
1 parent 4fbeded commit 7e30729

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

tools/core/image.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,26 +138,29 @@ def repo(self) -> Optional[str]:
138138
return repo
139139

140140
def _run_command(self, cmd):
141+
on_travis = "TRAVIS_BRANCH" in os.environ
142+
if on_travis:
143+
self._run_command_on_travis(cmd)
144+
return
145+
print("$ %s" % cmd)
146+
exit_code = os.system(cmd)
147+
if exit_code != 0:
148+
raise RuntimeError("Failed to build (exit_code=%s)" % exit_code)
149+
150+
def _run_command_on_travis(self, cmd):
141151
self._logger.info(cmd)
142152

143153
stop = threading.Event()
144154

145155
def f():
146156
nonlocal stop
147157
counter = 0
148-
on_travis = "TRAVIS_BRANCH" in os.environ
158+
149159
while not stop.is_set():
150160
counter = counter + 1
161+
print("Still building... ({})".format(counter), flush=True)
162+
stop.wait(10)
151163

152-
if on_travis:
153-
print("Still building... ({})".format(counter), flush=True)
154-
stop.wait(10)
155-
continue
156-
157-
print(".", end="", flush=True)
158-
stop.wait(1)
159-
if not on_travis:
160-
print()
161164
threading.Thread(target=f).start()
162165
try:
163166
output = execute(cmd)

0 commit comments

Comments
 (0)