ohare93 / brain-brew

Automated Anki flashcard creation and extraction to/from Csv
The Unlicense
89 stars 5 forks source link

Fix creation of missing directories #12

Closed aplaice closed 3 years ago

aplaice commented 3 years ago

The two issues were that

  1. Path() wasn't passed an argument.

  2. Running a directory through os.path.dirname() strips the trailing /, so running it through os.path.dirname() a second time will return its parent directory, which is obviously not what we want.

(Excessively verbose explanation, since I find paths confusing...)


Without this, in the example case of AUG, if brain_brew_build/Ultimate Geography_xx/ and brain_brew_build/Ultimate Geography_xx/media/ did not both exist, brain-brew builder_files/source_to_anki.yaml failed.

ohare93 commented 3 years ago

Ah, good catch. Thank you very much for correcting :pray: