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.
The two issues were that
Path() wasn't passed an argument.
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/
andbrain_brew_build/Ultimate Geography_xx/media/
did not both exist,brain-brew builder_files/source_to_anki.yaml
failed.