Skip to content

Commit

Permalink
don't assume data folder exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Highfire1 committed Apr 18, 2024
1 parent 1799c6c commit f651b32
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions notion.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from dotenv import load_dotenv

from os import environ
Expand Down Expand Up @@ -63,6 +64,16 @@ class t:
linkedin = "LinkedIn"

def updateDataFromNotion(writeLocation="data/"):

if not os.path.exists(writeLocation):
os.makedirs(writeLocation)

if not os.path.exists(writeLocation + "images/"):
os.makedirs(writeLocation + "images/")

if not os.path.exists(writeLocation + "json/"):
os.makedirs(writeLocation + "json/")

load_dotenv()
if "NOTION_API_TOKEN" not in environ:
raise Exception("Please provide a Notion integration token.")
Expand Down

0 comments on commit f651b32

Please sign in to comment.