Skip to content

Commit

Permalink
wiping it up
Browse files Browse the repository at this point in the history
  • Loading branch information
SlothBorg committed May 16, 2023
1 parent 33ec098 commit 4f04a5a
Show file tree
Hide file tree
Showing 16 changed files with 11 additions and 8 deletions.
Empty file added Dungeon/Level_05/Room_01.md
Empty file.
Empty file added Dungeon/Level_05/Room_02.md
Empty file.
Empty file added Dungeon/Level_05/Room_03.md
Empty file.
Empty file added Dungeon/Level_05/Room_04.md
Empty file.
Empty file added Dungeon/Level_05/Room_05.md
Empty file.
Empty file added Dungeon/Level_05/Room_06.md
Empty file.
Empty file added Dungeon/Level_05/Room_07.md
Empty file.
Empty file added Dungeon/Level_05/Room_08.md
Empty file.
Empty file added Dungeon/Level_05/Room_09.md
Empty file.
Empty file added Dungeon/Level_05/Room_10.md
Empty file.
Empty file added Dungeon/Level_05/Room_11.md
Empty file.
Empty file added Dungeon/Level_05/Room_12.md
Empty file.
Empty file added Dungeon/Level_05/Room_13.md
Empty file.
Empty file added Dungeon/Level_05/Room_14.md
Empty file.
Empty file added Dungeon/Level_05/Room_15.md
Empty file.
19 changes: 11 additions & 8 deletions scripts/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ def validate_dirs(outer_dir, prefix):
if not path.exists(dir_path):
if not path.isdir(dir_path):
pathlib.Path(dir_path).mkdir(exist_ok=True)
write_file(dir_path, 'README.md', '')

file_path = path.join(dir_path, 'README.md')
write_file(file_path)

for i in range(1, MONTH + 1):
dir_name = prefix + '_' + f'{i:02}'
Expand All @@ -39,14 +41,16 @@ def validate_dirs(outer_dir, prefix):
if not path.exists(dir_path):
if not path.isdir(dir_path):
pathlib.Path(dir_path).mkdir(exist_ok=True)
write_file(dir_path, 'README.md', '')

file_path = path.join(dir_path, 'README.md')
write_file(file_path)

def write_file(file_path, name, content):
file_path = path.join(getcwd(), path.join(file_path, name))

def write_file(file_path, content=''):
if not path.exists(file_path):
with open(file_path, 'w') as f:
print(file_path)
print(path.exists(file_path))
with open(file_path, 'w') as f:
f.writelines(content)


Expand All @@ -63,12 +67,11 @@ def validate_files(project, month):
file_path = path.join(getcwd(), dir_name)

if not path.exists(file_path):
write_file

write_file(file_path)


for directory in PROJECTS:
# validate_dirs(directory, PROJECTS[directory])
validate_dirs(directory, PROJECTS[directory])
validate_files(directory, 5)
#

Expand Down

0 comments on commit 4f04a5a

Please sign in to comment.