feat: Collect .md files from daily notes directory
This commit is contained in:
parent
dbdfcb3de2
commit
ace2a98954
14
main.py
14
main.py
|
@ -7,7 +7,19 @@ logging.basicConfig(
|
|||
NOTES_DIR = '/home/tanner/notes-git/notes'
|
||||
|
||||
def collect_daily_notes():
|
||||
pass
|
||||
daily_notes_path = os.path.join(NOTES_DIR, 'Daily Notes')
|
||||
if not os.path.isdir(daily_notes_path):
|
||||
logging.error(f"Directory not found: {daily_notes_path}")
|
||||
return []
|
||||
|
||||
try:
|
||||
all_files = os.listdir(daily_notes_path)
|
||||
md_files = [f for f in all_files if os.path.isfile(os.path.join(daily_notes_path, f)) and f.endswith('.md')]
|
||||
logging.debug(f"Found .md files: {md_files}")
|
||||
return md_files
|
||||
except OSError as e:
|
||||
logging.error(f"Error accessing directory {daily_notes_path}: {e}")
|
||||
return []
|
||||
|
||||
def main():
|
||||
collect_daily_notes()
|
||||
|
|
Loading…
Reference in New Issue
Block a user