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

Ability to run a command instead of opening bash #22

Closed
kostajh opened this issue Apr 8, 2020 · 2 comments
Closed

Ability to run a command instead of opening bash #22

kostajh opened this issue Apr 8, 2020 · 2 comments

Comments

@kostajh
Copy link
Contributor

kostajh commented Apr 8, 2020

I'd like to be able to use fresh in a pre-commit hook for my extension, so I could have something like fresh-node --entrypoint=grunt stylelint or fresh-node --entrypoint stylelint --fix **/*/.less

@Krinkle Krinkle changed the title Provide ability for custom entrypoint Ability to run a command instead of opening bash Apr 8, 2020
@Krinkle
Copy link
Member

Krinkle commented Apr 8, 2020

Sounds good to me.

A few quick notes:

  • I added something like this unofficially for the test suite ("FRESH_INTERNAL_RUNCMD"). So I suggest we replace that with what we come up with here.
  • Note that grunt or stylelint would not be available here. I think it would be good practice to maintain those commands in package.json instead and invoke npm run … instead. That keeps the code central, avoids hardcoding for node_modules in Fresh, and makes it easier for users to run those same things by other means if they don't want or can't use pre-commit hooks.
  • Slight nitpick - "Entrypoint" might be too easily confused with the docker internals. Perhaps even simpler would be to consider all arguments after -- as the command to execute?

For example

fresh -- npm run lint
fresh -- npm run fix:less

@Krinkle
Copy link
Member

Krinkle commented May 29, 2020

Continue at https://phabricator.wikimedia.org/T253924.

@Krinkle Krinkle closed this as completed May 29, 2020
@tgr tgr mentioned this issue Dec 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants