anvilistas / amoni

A command line utility for local development of Anvil apps.
Other
14 stars 4 forks source link

"amoni init" give the error : KeyError: "config value 'user.name' was not found" #13

Closed telemix closed 1 year ago

telemix commented 1 year ago

I have a fresh install of docker and amoni on a fully updated Ubuntu 22.04. I ran amoni init demo and got this output :

$ amoni init demo
Traceback (most recent call last):

  File "/home/user/.local/bin/amoni", line 8, in <module>
    sys.exit(cmd())

  File "/home/user/.local/pipx/venvs/amoni/lib/python3.10/site-packages/amoni/cli/amoni.py", line 36, in init
    api.init(directory, app)

  File "/home/user/.local/pipx/venvs/amoni/lib/python3.10/site-packages/amoni/api.py", line 76, in init
    _commit_all("Initial commit", repo=repo, ref="HEAD", parents=[])

  File "/home/user/.local/pipx/venvs/amoni/lib/python3.10/site-packages/amoni/api.py", line 40, in _commit_all
    author = author or repo.default_signature

KeyError: "config value 'user.name' was not found"

I'm pretty sure I followed the instructions in the docs to the letter. What am I doing wrongly? I've not been asked by the app (or told by the docs) to put in any user or login details at this point.

meatballs commented 1 year ago

That looks to me like git isn't configured properly on your machine.

Try this from your command line:

git config --global user.name "Your Name"
git config --global user.email "youremail@yourdomain.com"

and then try amoni init demo

If that fixes it, I'll add some instructions to the docs.

telemix commented 1 year ago

Yes, that worked. Thanks. Me and git are still finding our feet ...

Just to be sure, can those just be anything, or are they used for fetching gitty stuff?

meatballs commented 1 year ago

They can be anything you like - but they appear on commits that you make and those are public if you push your repo to somewhere like github.