Skip to content

Commit 00b9591

Browse files
committed
While we're at it, when echoing output from shell.run(), echo the command that's running _before_ executing it instead of after so the user can actually see what's going on instead of getting confused by the ordering of the output after the fact.
1 parent 900a8e2 commit 00b9591

File tree

1 file changed

+3
-3
lines changed
  • utils/swift_build_support/swift_build_support

1 file changed

+3
-3
lines changed

utils/swift_build_support/swift_build_support/shell.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,10 @@ def run(*args, **kwargs):
213213
echo_output = kwargs.pop('echo', False)
214214
dry_run = kwargs.pop('dry_run', False)
215215
env = kwargs.get('env', None)
216-
if dry_run:
216+
if dry_run or echo_output:
217+
print(repo_path)
217218
_echo_command(dry_run, *args, env=env)
219+
if dry_run:
218220
return(None, 0, args)
219221

220222
my_pipe = subprocess.Popen(
@@ -225,8 +227,6 @@ def run(*args, **kwargs):
225227
if lock:
226228
lock.acquire()
227229
if echo_output:
228-
print(repo_path)
229-
_echo_command(dry_run, *args, env=env)
230230
if stdout:
231231
print(stdout, end="")
232232
if stderr:

0 commit comments

Comments
 (0)