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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot pre-commit #1403

Open
draylegend opened this issue Mar 8, 2024 · 4 comments
Open

cannot pre-commit #1403

draylegend opened this issue Mar 8, 2024 · 4 comments

Comments

@draylegend
Copy link

draylegend commented Mar 8, 2024

husky 9.0.11
node 20.11.1
npm 10.2.4
nx 18.1.0
WSL version: 2.0.14.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
MSRDC version: 1.2.4677
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22631.3235
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 12 (bookworm)
Release:        12
Codename:       bookworm
#.husky/pre-commit
git -v

running git commit -m "feat(lib): init" throws the error:

unknown option: -v
usage: git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           [--super-prefix=<path>] [--config-env=<name>=<envvar>]
           <command> [<args>]
husky - pre-commit script failed (code 129)

BTW. the latest git version is 2.44.0, not 2.9.* as mentioned in the docs

I did also install 2.44.0 from source, same error.

@typicode
Copy link
Owner

I don't know why it doesn't work 🤔 I'm getting this:

$ echo 'git -v' > .husky/pre-commit
$ git commit -m foo
git version 2.44.0

@draylegend
Copy link
Author

forgot to mention versions of WSL and debian

@typicode
Copy link
Owner

🤔 honestly don't know, try echo to create the file to get the code editor out of the picture?

@draylegend
Copy link
Author

OMG dat CRLF lol. Can anyone explain it to me why husky accepts only LF and not both?

@typicode u r AWESOME! thanks!

I'm using phpstorm and somehow it creates files with CRLF 😒

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants