@@ -31,6 +31,27 @@ async def stop(process, timeout=5.0):
3131 process .kill ()
3232
3333
34+ def tree (dir_path : Path , prefix : str = '' ):
35+ """A recursive generator, given a directory Path object
36+ will yield a visual tree structure line by line
37+ with each line prefixed by the same characters
38+ """
39+ space = ' '
40+ branch = '│ '
41+ tee = '├── '
42+ last = '└── '
43+
44+ contents = list (dir_path .iterdir ())
45+ # contents each get pointers that are ├── with a final └── :
46+ pointers = [tee ] * (len (contents ) - 1 ) + [last ]
47+ for pointer , path in zip (pointers , contents ):
48+ yield prefix + pointer + path .name
49+ if path .is_dir (): # extend the prefix and recurse:
50+ extension = branch if pointer == tee else space
51+ # i.e. space because last, └── , above so no more |
52+ yield from tree (path , prefix = prefix + extension )
53+
54+
3455async def env (
3556 osbuild_version ,
3657 osbuild_composer_version ,
@@ -140,6 +161,12 @@ async def env(
140161 await cli .wait ()
141162
142163 await asyncio .gather (stop (composer ), stop (worker ))
164+ print ("\n Logs are here" )
165+ print (path_tmp )
166+ for line in tree (Path (path_tmp )):
167+ print (line )
168+ print ("Inspect them now, then press [ENTER] to remove them" )
169+ input ()
143170
144171 return 0
145172
0 commit comments