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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

commit make terminal freeze #71

Closed
kamontat opened this issue Oct 18, 2017 · 5 comments
Closed

commit make terminal freeze #71

kamontat opened this issue Oct 18, 2017 · 5 comments

Comments

@kamontat
Copy link

Hello @carloscuesta!

my terminal hang/freeze when I use gitmoji -c

Issue:

my step is

  1. select emoji
  2. enter commit title
  3. let message empty
  4. let issue empty
  5. HANG

example result

? Choose a gitmoji: 馃敟  - Removing code or files.
? Enter the commit title: hello world
? Enter the commit message:
? Issue / PR reference:

screen shot 2560-10-18 at 23 06 07
gitmoji-cli -v: 1.8.1
Node version: v8.5.0

@carloscuesta
Copy link
Owner

Did you used the hook init method before? If it鈥檚 true that鈥檚 the issue you should delete the hook file.

However, you can try the cli on a fresh git repository?

Create a new directory, run git init add some random files and try to use the -c option. It should work as expected

@kamontat
Copy link
Author

kamontat commented Oct 19, 2017

Never and I try but still freeze.

@carloscuesta
Copy link
Owner

carloscuesta commented Oct 21, 2017

It's working fine for me @kamontat. There should be an issue with your environment

screen shot 2017-10-21 at 13 28 21

@kamontat
Copy link
Author

After I enter Issue and pr, what is script doing? Just call commit?

@carloscuesta
Copy link
Owner

gitmoji-cli/src/gitmoji.js

Lines 117 to 143 in eac2b61

_commit (answers) {
const title = `${answers.gitmoji} ${answers.title}`
const prefixReference = config.getIssueFormat() === constants.GITHUB
? '#'
: ''
const reference = (answers.reference)
? `${prefixReference}${answers.reference}`
: ''
const signed = config.getSignedCommit() ? '-S' : ''
const body = `${answers.message} ${reference}`
const commit = `git commit ${signed} -m "${title}" -m "${body}"`
if (!this._isAGitRepo()) {
return this._errorMessage('Not a git repository')
}
if (config.getAutoAdd()) {
execa.stdout('git', ['add', '.'])
.then((res) => console.log(chalk.blue(res)))
.catch((err) => this._errorMessage(err.stderr))
}
execa.shell(commit)
.then((res) => console.log(chalk.blue(res.stdout)))
.catch((err) => this._errorMessage(err.stderr ? err.stderr : err.stdout))
return commit
}

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants