Problem with amoni app add #12
bobincomox
started this conversation in
General
Replies: 1 comment
-
Thanks. Nice catch! Fix coming shortly... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I installed amoni locally and ran the 'hello-world' default app successfully. When I tried to add a simple app from my anvil account I got this error:
Added News as a submodule in the app directory
Traceback (most recent call last):
File "/home/bob/.local/bin/amoni", line 8, in
sys.exit(cmd())
File "/home/bob/.local/pipx/venvs/amoni/lib/python3.10/site-packages/amoni/cli/app.py", line 40, in add
api.set_app(name)
File "/home/bob/.local/pipx/venvs/amoni/lib/python3.10/site-packages/amoni/api.py", line 170, in set_app
_commit_all(f"Set {name} as the anvil app")
File "/home/bob/.local/pipx/venvs/amoni/lib/python3.10/site-packages/amoni/api.py", line 34, in _commit_all
os.chdir(repo.path)
AttributeError: 'NoneType' object has no attribute 'path'
I made the following change to the api.py file, and it then worked without a problem:
def _commit_all(
message, repo=None, ref=None, author=None, committer=None, tree=None, parents=None
):
cwd = os.getcwd()
# os.chdir(repo.path)
repo = repo or pygit2.Repository(".")
os.chdir(repo.path) # moved to here
repo.index.add_all()
repo.index.write()
I am new to git, github, anvil-works and amoni. I know there is a better way, such as a pull request?... but this discussion is easier for me.
Thanks so much for all your good work in the anvil community!
Beta Was this translation helpful? Give feedback.
All reactions