Fix Git import for nested export folders#252
Open
cnra wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi, first of all, thanks for this great addon. It helps a lot!
I ran into a small problem:
I had an Anki deck named
cryllicfor learning the Cyrillic alphabet and tried using it with CrowdAnki. I exported it, but I chose to export it into a custom folder namedanki-cryllic, since that seemed more suitable for GitHub usage with a clearer name.The exporter created an additional nested folder named
cryllicinside theanki-cryllicdirectory. I then pushed this structure to GitHub in this repository:https://github.com/cnra/anki-cryllic
Then I tried to import it from GitHub. However, the import failed because
deck.jsonwas not found. The file was not at the root of the repository checkout, but inside the nested folder.I inspected the code and saw that nested directories were already considered, but only under the assumption that the nested folder name is the same as the root folder name. In this example, it was not.
This fix makes the import logic more general: it now finds
deck.jsonwherever it exists inside the nested export directory.