-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat(link): add --force flag #122
Conversation
Thanks a ton for contributing! This is honestly a fantastic idea! Although my only concern is the So I'm 100% on board with the concept, as well as love the implementation, very much appreciating the specs you've written as well. But curious if @DeeDeeG has any thoughts on the best flag name. But overall looks awesome! |
I chose
You're welcome. I'm happy to help out! |
I'm fuzzy on the use case here. Assume cd ~/Code/AtomPackages # or whatever
git clone git@github.com:foo/language-foo
cd language-foo
npm install
ppm link --dev . Packages in I think if a package is going to be removed from the directory, it should be uninstalled first, even if This isn't a veto; just want to understand it better. |
From my understanding the use case is essentially:
So I can absolutely see the valid use case, and it does make complete sense, since very likely you'd want to be able to track your changes on your own fork, so will need to download it again elsewhere prior to publication. While yes it could be uninstalled first, I get that it can become repetitive. So while I think it's a total valid use case, I have to admit it's probably only valid for a small portion of the userbase, which is why I feel like a non-standard flag may be more appropriate. While it makes things easier for the population that needs it, it doesn't use something too common that people might misunderstand the effect it has. But if you feel that it's not a widespread use enough, I'm happy to hear it out and reconsider |
@claytonrcarter Thanks for the feedback. It feels good to me to change it, but I'm not the most attached to this repo, so I'd much rather get the opinion of someone like I've pinged if they feel it's at all necessary. But I do totally get that it's a perfect standard flag, which is partially why it might be good to change it, so it's not easy to do without realizing the effect. Since I don't want someone to assume it forces the linking process, not realizing it forces the deletion of a file elsewhere on the system, since the force usually means to force the action taking place, rather than some side effect of the action. An example that kinda works for me is a command that connects to a wifi network using |
It's only slightly fewer keystrokes than |
The compelling part of this, for me, is convenience. If I run Other options
Prior art
Do you mean that you'd prefer that the user have to run
I grant that this is the "blessed" path for this sort of thing, but – personally – I long ago stopped using dev mode because I found it easier and more convenient to just link my customized packages directly into
This is true, and it is a pretty straightforward workaround to have to manually uninstall or remove the package/dir that's in way. Adding a quick and simple way to say "yeah yeah yeah, I know what I'm doing, just create the link already" feels like a valid enough use case that it's might be worth a small DX/QOL improvement. |
I don't feel strongly enough about this to keep discussing it when there are syntax highlighting fixes to do, so I'll leave you folks to it. :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me! As a sometimes Linux user (and to the extent I'm in the CLI on macOS), this is indeed what I'd expect it to be named, personally.
Reasonable and neat little feature that I hope no-one has the misfortune of using accidentally or without understanding what it means, but they have to go out of their way to do so, so IMO it's on them to know what it does and it's kind of what I'd expect "forcing" the link to do, personally. Not that it's totally unambiguous to folks unused to doing rm -rf
where it's not already ringing a bell what this might do, I guess.
I sympathize with wanting to preserve whatever modifications or content a user might have accumulated in a given package's dir. But as an optional flag I feel it's a fair trade-off as-is. I can support giving users this tool, and having them have to reach for it by typing it in, but I don't think it's worthwhile to make it rather un-ergonomic by being long, at the cost of being able to type it easily, for the benefit of preventing the potential mistakes.
Implementation in src/
looks fine, I didn't review the specs very closely, but they are passing, so that's good enough for me!
Thanks for the contribution!
P.S. apologies for the delay, I've been away for a bit and am catching up on things.
Thanks for taking a look at this one @DeeDeeG and glad to see you merged it. Also of course thanks a ton to @claytonrcarter for your wonderful contribution and patience! |
Hi there, now that I'm using Pulsar, I find myself with a fair number of old Atom packages that need tweaks or updates, and so I'm doing this dance a lot:
Obviously, the fix is simple and easy (
rm -rf $CURRENTLY_INSTALLED_PACKAGE
& try again), but it also felt like a--force
flag would be handy to just do that for me while rerunning the command.This was a pretty trivial change, and I'm happy to make changes as desired. I added 2 tests: one to confirm that it errors if the target exists, and another to confirm that it nukes it and then links when used with the
--force
flag.Alternatives
I briefly considered calling it
link --triforce
. ⚔️Thank you!