File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -13,17 +13,17 @@ jobs:
13
13
from typing import Iterator
14
14
URL_BASE = "https://github.com/TheAlgorithms/Ruby/blob/master"
15
15
g_output = []
16
-
16
+
17
17
def good_filepaths(top_dir: str = ".") -> Iterator[str]:
18
18
for dirpath, dirnames, filenames in os.walk(top_dir):
19
19
dirnames[:] = [d for d in dirnames if d[0] not in "._"]
20
20
for filename in filenames:
21
21
if os.path.splitext(filename)[1].lower() == ".rb":
22
22
yield os.path.join(dirpath, filename).lstrip("./")
23
-
23
+
24
24
def md_prefix(i):
25
25
return f"{i * ' '}*" if i else "\n##"
26
-
26
+
27
27
def print_path(old_path: str, new_path: str) -> str:
28
28
global g_output
29
29
old_parts = old_path.split(os.sep)
32
32
if new_part:
33
33
g_output.append(f"{md_prefix(i)} {new_part.replace('_', ' ').title()}")
34
34
return new_path
35
-
35
+
36
36
def build_directory_md(top_dir: str = ".") -> str:
37
37
global g_output
38
38
old_path = ""
47
47
return "\n".join(g_output)
48
48
with open("DIRECTORY.md", "w") as out_file:
49
49
out_file.write(build_directory_md(".") + "\n")
50
-
50
+
51
51
- name : Update DIRECTORY.md
52
52
run : |
53
53
cat DIRECTORY.md
You can’t perform that action at this time.
0 commit comments