langfield / ki

version control for Anki collections
https://langfield.github.io/ki/
GNU Affero General Public License v3.0
80 stars 3 forks source link

Treat case where `repo.git.rm` fails on dirs with no files #131

Closed langfield closed 1 year ago

langfield commented 1 year ago

A fix for the following sub-issue raised within #128.

I've ran everything as mentioned here:

So here's how you'd do this.

  1. Clone this repository, put submodule.py somewhere you can find it.
  2. Create a new Github repository for your submodule, perhaps git@github.com:abbradar/mydeck.git.
  3. Let's assume your cloned collection is in your home directory, and that's where you put submodule.py as well. Then run python3 submodule.py --kirepo collection/ --deck my-deck --remote git@github.com:abbradar/mydeck.git.

That should do it.

I've created a desk called programming, ran the submodule script on it. Worked fine, after I added at least one file to the _media folder (otherwise the git rm call inside the submodule.py script does not remove all folders, and the script subsequently fails).