question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

gitmoji-cli 3.2.2 showing weird messages in terminal when commiting

See original GitHub issue

Hello @carloscuesta!

Hi, I updated to 3.2.2, and everything seems to work fine, except some weird messages appearing in my terminal when commiting

Anyways, this isn’t important. I can commit changes, but I think this should be fixed

This is my terminal log:

andres on acer laptop at Alexis > git commit events/client/message.js 
// These are the error messages
.git/hooks/prepare-commit-msg: 6: [[: not found
.git/hooks/prepare-commit-msg: 8: [[: not found
.git/hooks/prepare-commit-msg: 6: [[: not found
.git/hooks/prepare-commit-msg: 8: [[: not found
.git/hooks/prepare-commit-msg: 6: [[: not found
.git/hooks/prepare-commit-msg: 8: [[: not found
.git/hooks/prepare-commit-msg: 6: [[: not found
.git/hooks/prepare-commit-msg: 8: [[: not found
.git/hooks/prepare-commit-msg: 6: [[: not found
.git/hooks/prepare-commit-msg: 8: [[: not found
.git/hooks/prepare-commit-msg: 6: [[: not found
.git/hooks/prepare-commit-msg: 8: [[: not found
.git/hooks/prepare-commit-msg: 6: [[: not found
.git/hooks/prepare-commit-msg: 8: [[: not found
.git/hooks/prepare-commit-msg: 6: [[: not found
.git/hooks/prepare-commit-msg: 8: [[: not found
.git/hooks/prepare-commit-msg: 6: [[: not found
.git/hooks/prepare-commit-msg: 8: [[: not found
// Now, the usual behavior continues.
? Choose a gitmoji: 🔥  - Removing code or files.
? Enter the commit title [23/48]: Removed betacmd feature
? Enter the commit message: Removed betacmd feature in message.js. Separate beta
 bot will be created
[master 334b70b] 🔥 Removed betacmd feature
 1 file changed, 31 deletions(-)

OS: Ubuntu 19.10 gitmoji-cli -v: 3.2.2 Node version: 12.16.1

Error Message: None

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Addonocommented, Mar 12, 2020

Hmm, my bad 😞 The changes I made to the hook script were using some extensions to the POSIX shell, which are only supported in shells like bash and zsh. It is not reproducible on MacOS as MacOS defaults to using a shell with extended POSIX support.

https://github.com/carloscuesta/gitmoji-cli/blob/8f71bff1561b180cd25c8bb734c77adf154d8bf7/src/commands/hook/hook.js#L5 This shebang should be replaced with #!/bin/bash or #!/usr/bin/env bash instead.

I’d add that if your script doesn’t start with a shebang that explicitly requests a shell that supports [[ ]] (e.g. bash with #!/bin/bash or #!/usr/bin/env bash), you should use the portable option. Scripts that assume /bin/sh supports extensions like this will break on OSes like recent Debian and Ubuntu releases where that’s not the case. – Gordon Davisson https://stackoverflow.com/a/13542854/7500339

0reactions
ghostcommented, Mar 11, 2020

Now working! Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Enjoy your commit with gitmoji-c - sa.nitawaki - Medium
My company has a 'gitmoj' culture. This is the practice of putting 'gitmoji' at the beginning of the commit message when committing.
Read more >
gitmoji-cli - npm
A gitmoji client for using emojis on commit messages. ... Start using gitmoji-cli in your project by running `npm i gitmoji-cli`.
Read more >
Git commit in terminal opens VIM, but can't get back to terminal
To save your work and exit press Esc and then : w q (w for write and q for quit). Alternatively, you could...
Read more >
homebrew-core - Homebrew Formulae
a2ps 4.14 Any‑to‑PostScript filter aacgain 1.8 AAC‑supporting version of mp3gain aalib 1.4rc5 Portable ASCII art graphics library aamath 0.3 Renders mathematical expressions as ASCII art
Read more >
🔨 [git]: Write better commits with Gitmoji - DEV Community ...
Gitmoji is an initiative to standardize and explain the use of emojis on GitHub commit messages. 📝 Intro : How to Write a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found