Skip to content

Commit 2ef1ec6

Browse files
authored
#68 add gitkeep folder for done section
1 parent 4174ab8 commit 2ef1ec6

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ http*
2525

2626
readme.sh
2727
*.yaml
28+
29+
*.attrs

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ bash runme.sh refresh_map
7373
```bash
7474
bash runme.sh refresh_links
7575
```
76+
- refresh puml
77+
78+
```bash
79+
bash runme.sh refresh_puml
80+
```
81+
![](a0892483-ce6f-4ab1-bbd3-99f5ad7e7e8b.png)
7682

7783
- help
7884

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = 1.8

zero_to_one_hundred/repository/persist_fs.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def list_dirs(cls, path) -> List[str]:
2020
logging.info(f"list_dirs {path}")
2121
files = [ os.path.join(path, name) for name in os.listdir(path) if os.path.isdir(os.path.join(path, name))]
2222
files.sort(key=lambda x: os.path.getmtime(x))
23-
return [f[len(path)+1:] for f in files]
23+
return [f[len(path)+1:] for f in files]
2424

2525
@classmethod
2626
def get_dir_name(cls, filename):
@@ -51,7 +51,7 @@ def make_dirs(cls, path):
5151
logging.info(f"_skip {path}")
5252
return None
5353
logging.info(f"_create {path}")
54-
return os.makedirs(path, 0o777, False)
54+
return os.makedirs(path, 0o777, True)
5555

5656
@classmethod
5757
def read_file(cls, filename) -> List[str]:
@@ -89,10 +89,12 @@ def done_section(cls, path):
8989
path = path + os.sep + ".done"
9090
logging.info(f"path {path}")
9191
if os.path.exists(path):
92-
logging.info(f"skip {path}")
93-
else:
94-
os.makedirs(path, 0o777, False)
92+
logging.info(f"found {path}")
93+
os.makedirs(path, 0o777, True)
94+
with open('{}/.gitkeep'.format(path), "a"):
95+
os.utime('{}/.gitkeep'.format(path), None)
9596
logging.info(f"created {path}")
97+
9698

9799
@classmethod
98100
def done_section_status(cls, abs_repo_path, path):

0 commit comments

Comments
 (0)