File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
lib/Terminal/Widgets/Volatile Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -54,14 +54,18 @@ class Dir does Parent {
5454 # Directory read may fail due to insufficient permissions
5555 try my @ entries = $ ! path . dir ;
5656
57- @ ! children = @ entries . map : {
58- . d ?? Dir. new ( parent => self , path => $ _ ) !!
59- . l ?? SymLink. new (parent => self , path => $ _ , target => . readlink) !!
60- . f ?? File. new ( parent => self , path => $ _ ) !!
61- . dev ?? Dev. new ( parent => self , path => $ _ ) !!
62- Misc. new ( parent => self , path => $ _ ) ;
63- };
57+ @ ! children = @ entries . map ({ dir-tree-node($ _ , parent => self ) });
6458 }
6559 @ ! children
6660 }
6761}
62+
63+ sub dir-tree-node (IO ::Path: D () $ path , Node : $ parent ) is export {
64+ with $ path {
65+ . d ?? Dir. new ( : $ parent , path => $ _ ) !!
66+ . l ?? SymLink. new (: $ parent , path => $ _ , target => . readlink) !!
67+ . f ?? File. new ( : $ parent , path => $ _ ) !!
68+ . dev ?? Dev. new ( : $ parent , path => $ _ ) !!
69+ Misc. new ( : $ parent , path => $ _ ) ;
70+ }
71+ }
You can’t perform that action at this time.
0 commit comments