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

how to get git params #71

Closed
Leslie2014 opened this issue Oct 10, 2016 · 4 comments
Closed

how to get git params #71

Leslie2014 opened this issue Oct 10, 2016 · 4 comments

Comments

@Leslie2014
Copy link

hi.
i want to prevent git push when branch name match the regular expression.
so, the question is, how can i get the command cli param.
e.g: git push publish/0.0.4, the string 'publish/0.0.4' is what is want.

@typicode
Copy link
Owner

hi @Leslie2014,

Git params are passed in GIT_PARAMS:

"prepush": "node prepush.js"
// prepush.js
console.log(process.env.GIT_PARAMS)

I'll update the README :)

@Leslie2014
Copy link
Author

Thanks! : )

@ghun131
Copy link

ghun131 commented Jun 30, 2019

Hi @typicode , I know this issue is closed but I ran into this same situation and it doesn't work like your answer. I also try #113 (comment) but to no avail. Of course I knew that prepush is now pre-push but still. If I use HUSK_GIT_PARAMS then I only receive the url for repo but not the branch name. Is there a way to work around this? Many thanks!

@shiftgeist
Copy link

I have the same issue as @ghun131 and didn't find any workaround yet.

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