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

I can't get $param in husky script? #527

Closed
zzzgit opened this issue Jul 4, 2019 · 6 comments
Closed

I can't get $param in husky script? #527

zzzgit opened this issue Jul 4, 2019 · 6 comments

Comments

@zzzgit
Copy link

zzzgit commented Jul 4, 2019

image

I wrote this like above, and then I got:

image

Why the variable could not be interpreted?

@mrfelton
Copy link

Also not working for me

@zzzgit
Copy link
Author

zzzgit commented Aug 1, 2019

no solution yet?

@typicode
Copy link
Owner

I can't seem to be able to reproduce the issue:

$ cat .huskyrc.js
module.exports = {
  hooks: {
    'prepare-commit-msg': 'echo $HUSKY_GIT_PARAMS && exit 1',
  }
}

$ git commit -m test
husky > prepare-commit-msg (node v12.8.1)
.git/COMMIT_EDITMSG message
...

What's your OS/Terminal/Git client?
Can you try changing prepare-commit-msg to this:

'prepare-commit-msg': 'node index.js'
// index.js
console.log('HUSKY_GIT_PARAMS', process.env.HUSKY_GIT_PARAMS)

@zzzgit
Copy link
Author

zzzgit commented Sep 13, 2019

node index.js

win7, git bash

Can you try changing prepare-commit-msg to this:

image

@MartinYounghoonKim
Copy link

I have same issue. any update ?

@typicode
Copy link
Owner

typicode commented Jan 7, 2021

Closing as HUSKY_GIT_PARAMS has been removed in v5. Also the most recent v4 has received a fix regarding prepare-commit-msg on Windows #737

@typicode typicode closed this as completed Jan 7, 2021
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

4 participants