File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1919from shutil import rmtree , which
2020from typing import Union
2121from collections .abc import Generator
22+ import time
2223
2324PathLike = Union [Path , str , bytes ]
2425
@@ -144,13 +145,15 @@ def run(args: str | list[str], cd: PathLike | None = None) -> None:
144145 """
145146 cmd = " " .join (args )
146147 print (">> Running command:" , cmd )
148+ start_time = time .time ()
147149 if cd is not None :
148150 with cd_context (_resolve (cd , strict = True )):
149151 result = subprocess .run (args )
150152 else :
151153 result = subprocess .run (args )
152-
153- print (">> Command finished:" , cmd , "\n " )
154+ elapsed_time = time .time () - start_time
155+ minutes , seconds = divmod (elapsed_time , 60 )
156+ print (f">> Command finished ({ int (minutes )} m { int (seconds )} s): { cmd } \n " )
154157
155158 # TODO: Should we exit here? Or continue to let other commands run also?
156159 if result .returncode != 0 :
You can’t perform that action at this time.
0 commit comments