juliaup icon indicating copy to clipboard operation
juliaup copied to clipboard

Add ability to relink a channel (mainly dev)

Open ndinsmore opened this issue 2 years ago • 5 comments

It would be great if you could relink a channel like dev to a new location without having to undefault it then remove it first.

ndinsmore avatar Feb 17 '23 20:02 ndinsmore

Something like juliaup link update dev <DIR>? I can take you up on this. Just need this clarification (or if you have a sample command in mind).

AbhinavMir avatar Mar 08 '23 18:03 AbhinavMir

Maybe even simpler and just let juliaup update dev <PATH> work for already linked binaries.

ndinsmore avatar Mar 08 '23 22:03 ndinsmore

Command update already exists, any other name we could think of? link update or relink seem more explicit/intuitive here.

https://github.com/JuliaLang/juliaup/blob/051886cff975564d3fdf09dcd5330d9764ccefc8/src/bin/juliaup.rs#L173

Also quickly verifying my approach here: Wouldn't relink just remove the channel from installed_channel and then just re-add it all in the same function? Is there any other way to go about this?

AbhinavMir avatar Mar 09 '23 06:03 AbhinavMir

The problem is that right now you have to do 4 things if a link channel is your default

  1. Change default to a different channel
  2. Delete the link channel
  3. recreate link to new location
  4. change the default back to that link

It would be great if that was a single step. So if relink does all those steps that is great.

ndinsmore avatar Mar 12 '23 16:03 ndinsmore

Best to also write out tests, I was OOO yesterday so didn't get to work on this. Will add some tests.

AbhinavMir avatar Mar 13 '23 01:03 AbhinavMir