File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed
Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,31 @@ function good_filepaths(top_dir = ".") {
3030 } )
3131}
3232
33+ function md_prefix ( i ) {
34+ if ( i ) {
35+ let res = ' ' . repeat ( i ) ;
36+ return res + "*" ;
37+ } else {
38+ return "\n##"
39+ }
40+ }
41+
42+ function print_path ( old_path , new_path ) {
43+ let old_parts = old_path . split ( path . sep ) ;
44+ let new_parts = new_path . split ( path . sep ) ;
45+ for ( let i = 0 ; i < new_parts . length ; ++ i ) {
46+ let new_part = new_parts [ i ] ;
47+ if ( i + 1 > old_parts . len || old_parts [ i ] != new_part ) {
48+ if ( new_part ) {
49+ g_output . push ( `${ md_prefix ( i ) } ${ new_part . replace ( '_' , ' ' ) } ` ) ;
50+ // console.log(`${md_prefix(i)} ${new_part.replace('_', ' ')}`);
51+ }
52+ }
53+ }
54+ return new_path ;
55+ }
56+
3357good_filepaths ( ) ;
3458setTimeout ( ( ) => {
35- console . log ( filepaths . length ) ;
59+ console . log ( filepaths ) ;
3660} , 1000 ) ;
You can’t perform that action at this time.
0 commit comments