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 variables escaped when using a cli to pass hook options #865

Closed
simple-beck opened this issue Feb 4, 2022 · 1 comment
Closed

Comments

@simple-beck
Copy link

npx release-it --hooks.after:release="echo Successfully released ${name} v${version} to ${repo.repository}."

This would just strip off the variables part as arguments get passed to the module. I tried escaping using single quotes -> nothing helps. I would appreciate if someone has a working solution

@webpro
Copy link
Collaborator

webpro commented Feb 5, 2022

This seems to work:

npx release-it --'hooks.after:release="echo Successfully released ${name} v${version} to ${repo.repository}."'

So single-quote the argument as a whole. It isn't pretty indeed! Better suggestions are welcome of course. By the way, release-it uses yargs-parser for this, but it doesn't mention colons.

@webpro webpro closed this as completed in ea11a0d Apr 9, 2022
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