carloscuesta / gitmoji-cli

A gitmoji interactive cli tool for using emojis on commits. 💻

Home Page:https://www.npmjs.com/package/gitmoji-cli

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Option `autoAdd` is not working

KirianCaumes opened this issue · comments

Describe the bug

The option autoAdd from the documentation doesn't seems to work when set to true: it doesn't run git add . and so, new files are not staged.

I tried to put the configuration in the package.json or .gitmojirc.json, without success.

Maybe I did configure something wrong, but I have no idea what, if that's the case.

I'd be happy to provide more information if needed, thanks for your help 🙏

Reproduction

Run:

npm i -g gitmoji-cli #v6.2.0
gitmoji -i

Create a new file, for example a test.txt.

package.json:

{
  "gitmoji": {
    "autoAdd": true,
    "emojiFormat": "emoji",
    "scopePrompt": true,
    "gitmojisUrl": "https://gitmoji.dev/api/gitmojis"
  }
}

Create a new commit with git commit -a and follow instructions from gitmoji, new files won't be added.

System Info

System:
    OS: Linux 5.10 Ubuntu 20.04.3 LTS (Focal Fossa)
    CPU: (4) x64 Intel(R) Core(TM) i5-9600K CPU @ 3.70GHz
    Memory: 6.69 GB / 9.73 GB
    Container: Yes
    Shell: Unknown - /bin/sh
  Binaries:
    Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node
    npm: 8.5.0 - ~/.nvm/versions/node/v16.14.2/bin/npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating duplicates.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Hey!

The autoAdd feature only works when comitting through the cli not through the hook

Thanks for opening the issue 😊

Alright,

Thanks for lightning fast answer!

Why it's only available with the CLI? Do you think it might not be useful with the hook?

I don't know if there's an easy way to implement this.

Sure! You can take a look at this for more context:

#168 (comment)