Skip to content

Commit

Permalink
Create the data dir earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
nygrenh committed Oct 6, 2023
1 parent b669af4 commit d27e8c7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,14 @@ def main():

abspath = os.path.abspath(current_file_path)
dname = os.path.dirname(abspath)
print(f"Changing working directory to {dname}")
print(f"Using working directory {dname}")
os.chdir(dname)

# Create the data folder if it does not exist
if not os.path.exists("./data"):
print("Creating ./data folder. You'll need to place the exported data there.")
os.makedirs("./data")

# If config.yml does not exist, create it from the template
if not os.path.exists("config.yml"):
with open("config.yml", "w") as f:
Expand All @@ -45,10 +50,6 @@ def main():
cfg = yaml.load(ymlfile, Loader=yaml.FullLoader)
print("Loaded config.yml")

# Create the data folder if it does not exist
if not os.path.exists("./data"):
os.makedirs("./data")

# Read the needed files from the ./data repository
submission_files = []
exercise_tasks_files = []
Expand Down

0 comments on commit d27e8c7

Please sign in to comment.