Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work with submodules #21

Open
2 tasks done
BlueGreenMagick opened this issue Sep 2, 2021 · 2 comments
Open
2 tasks done

Doesn't work with submodules #21

BlueGreenMagick opened this issue Sep 2, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@BlueGreenMagick
Copy link
Contributor

Problem description

Please describe the issue concisely in here. In case of an error: Walk us through the steps you took to get there. What happened? What did you expect to happen?

aab build doesn't build the addon with its submodules. Its submodules gets left out of the resulting ankiaddon file.

Checklist

Please replace the space inside the brackets with an x if the following items apply:

  • I've verified that I use the latest version of aab
  • I've checked if anyone else reported this problem before by looking through the issue reports. I also checked to see if there is a section about known issues in the add-on description, documentation, or README.

Information about your set-up

Please run aab -h and paste the output below:

Anki Add-on Builder v0.1.4

Copyright (C) 2016-2019  Aristotelis P. (Glutanimate)  <https://glutanimate.com>

This program comes with ABSOLUTELY NO WARRANTY;
This is free software, and you are welcome to redistribute it
under certain conditions; For details please see the LICENSE file.

usage: aab [-h] [-v] {build,ui,clean} ...

positional arguments:
  {build,ui,clean}
    build           Build and package add-on for distribution
    ui              Compile add-on user interface files
    clean           Clean leftover build files

optional arguments:
  -h, --help        show this help message and exit
  -v, --verbose     Enable verbose output

Please fill in details about your operating system and environment:

  • OS: Ubuntu
  • Python version: 3.8.10
  • Anki version: 2.1.47

Error message (if any)

If you've received an error message, please copy and paste it between the backticks below:

@BlueGreenMagick BlueGreenMagick added the bug Something isn't working label Sep 2, 2021
@glutanimate
Copy link
Owner

Hey, appreciate the report! Could you maybe link me a sample repo, so that I can take a quick look?

Outside of that, this definitely sounds like a great feature to have in, so I would be more than happy to accept a PR.

@BlueGreenMagick
Copy link
Contributor Author

BlueGreenMagick commented Sep 3, 2021

Here's a repo using a git submodule: https://github.com/BlueGreenMagick/Review-Hotmouse/ in addon/ankiaddonconfig.

I'd love to make a PR, but I'm not sure how to go about implementing that. I can do it for submodule HEAD with the following code in git.archive:

git submodule foreach 'git archive --format tar --prefix=$displaypath/ HEAD | tar -x -C $toplevel/{outdir}/'

But I have no idea how to get the submodule code at {ver} of super-module.

Maybe it could be done like such:

CURR_HEAD=$(git rev-parse HEAD)
git checkout {ver}
git submodule update --recursive
git submodule foreach 'git archive --format tar --prefix=$displaypath/ HEAD | tar -x -C $toplevel/{outdir}/'
git checkout $(CURR_HEAD)
git submodule update --recursive

But this seems really messy, and the checkout won't work when there are uncommitted files anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants