-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
30 lines (26 loc) · 1.09 KB
/
setup.py
File metadata and controls
30 lines (26 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import os
from settings import DIRECTORIES
def setup_directories():
"""Create required directory structure"""
# Create base directories
for dir_path in DIRECTORIES.values():
os.makedirs(dir_path, exist_ok=True)
# Create .gitkeep to maintain directory structure
gitkeep_path = os.path.join(dir_path, '.gitkeep')
if not os.path.exists(gitkeep_path):
open(gitkeep_path, 'a').close()
# Create sessions directory
os.makedirs('sessions', exist_ok=True)
open(os.path.join('sessions', '.gitkeep'), 'a').close()
# Ensure input-docs/default and input-docs/main exist
input_docs = DIRECTORIES['input']
required_subdirs = ['default', 'main']
for subdir in required_subdirs:
subdir_path = os.path.join(input_docs, subdir)
os.makedirs(subdir_path, exist_ok=True)
# Create .gitkeep in each required subdirectory
gitkeep_path = os.path.join(subdir_path, '.gitkeep')
if not os.path.exists(gitkeep_path):
open(gitkeep_path, 'a').close()
if __name__ == "__main__":
setup_directories()