Closed eleftrik closed 3 months ago
@eleftrik Could it be an environmental dependency issue?
Using "printf" rather than "echo -e" may give the expected behavior.
@yuyutar1 Honestly, I don't know... 🤷 I never noticed this problem.
I've always used echo -e
in my scripts and got the expected behavior.
I started to experience this "issue" after upgrading Husky to the latest release. I think I could use printf
, but I solved it by removing -e
from echo
lines.
I just wanted to understand what's happening for the sake of curiosity 😄
Oh, I think I got it.
_/h
script (which is included by Husky) starts with
#!/usr/bin/env sh
So, I think Korn shell doesn't support -e
.
This is not an issue.
In my
pre-commit
hook I got several lines like this:echo -e "And occurred.\n\nPlease check etc."
The problem is that
-e
is printed on the screen, but it shouldn't. (Sorry, maybe I'm lacking some Bash concepts).I use a custom directory for GIT hooks:
.git/config
hashooksPath = .encodia/dev/githooks/_
.I was able to fix the problem removing the final underscore (so
.git/config
hashooksPath = .encodia/dev/githooks
). This way,-e
is not shown anymore on the screen (problem solved), butnpm prepare
every time adds/_
again to.git/config
.What am I doing wrong? I guess the
_
is required because it runs some internal scripts. To summarize, I would like to be able to runecho -e "...."
without problems. Any hint?Thank you!