-
Notifications
You must be signed in to change notification settings - Fork 1k
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 want to alias ‘yarn rw’ so badly #328
Comments
Just |
I do not, but I'm willing to do some research! To that point might end up being too complicated to cover all cases. Maybe inspect for a limited number of shells/OS's and then gracefully decline if "not recognized". We could recommend alias, e.g. "rw", but then let the user input their choice. The easiest way forward --> within "Next Steps" message after successful CRA installation, make a suggestion for users to manually set up themselves. |
|
If it does, we could just put a |
@weaversam8 This is exactly what yarn does. They're talking about invoking the commands without having to prefix it with |
No sorry, I meant that NPM already has the ability to add commands without prefixing it with Yarn. When you install I'm pretty sure this should also work if you install This functionality is provided by the |
Thanks for the clarification @weaversam8. A bit more about how this works. Globally installed packages, that have " echo $PATH
/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
which gatsby
/usr/local/bin/gatsby We do this for our CLI over here: redwood/packages/cli/package.json Lines 6 to 9 in 583ca40
But, we prefer not to have people install our CLI globally since we update the CLI fairly frequently and would like to pin it to the redwood projects where you're invoking it from. We imagine you might have several Redwood projects with different versions. For people that hate typing
|
Is there any reason we couldn't roll this into the normal CLI package anyways? That way if someone installs it globally, it'll search first for a local version when executed? |
Thanks for chiming in here with discussion and adding clarity + specifics. I did edit the original comment by adding “The Rules” section. Please read 👀 there are important design choices that require the |
@arjunv27 If I understand you correctly, I’m not sure this will be possible. Could you give me an example? That will help me make sure I understand and I could also better explain my thinking. |
@thedavidprice |
@arjunv27 Ah, thanks for the example. I can see how/why people will alias for this case. But for me it’s not a commmon command I need so wasn’t thinking the same way. More importantly, from a Redwood installation perspective, we won’t address this because it’s specific to using yarn / yarn tooling. But, again, not that it isn’t something you and many others many very well want to do! |
To research: Wondering what they’re doing under the hood. |
Not sure if this will add much to the discussion, but |
@pickleat Nice! I think the trick on this would be to figure out how to support the top 3-4 shells across Linux/Mac and Windows: bash, zsh, PowerShell, etc. During installation could check shell environment and, if support, prompt user if they want to make life much radder. Totally doable. And I think totally worth it! (Just need 36 hours in a given day to get it done... ) Anyway, thanks for chiming in 😁 |
@thedavidprice Are we OK to close this one off now? |
This can be accomplished via #3094 |
Hypothetically, if our installation script prompted users:
“Would you like to alias command line ‘yarn rw’ to ‘r’? y/n”
Would that really be so bad?
Talk me in/out of this ‘cause I’m feeling motivated.
😉
The Rules
yarn
package.json
bin executableThe text was updated successfully, but these errors were encountered: