marler8997 / zigup

Download and manage zig compilers.
MIT No Attribution
784 stars 61 forks source link

add a command to switch to the most recent local version #110

Open travisstaloch opened 10 months ago

travisstaloch commented 10 months ago

i would guess that i run $ zigup master maybe twice a month. its much more common that i switch between 0.11 and my most recent local version. to do so i need to run these commands:

$ zigup 0.11.0 # this is nice. one command to switch to 0.11

# later on when i want to switch back i need to run two commands, and paste the version into the second.

$ zigup list
0.11.0
0.12.0-dev.2341+92211135f

$ zigup 0.12.0-dev.2341+92211135f

this isn't bad but would be nice if there were a single command i could run. the only reason i bring it up is that its my most common usage of zigup. i wonder if this is possible?

this is what i'd like to be able to do.

$ zigup local-master # don't download anything. switch to local version 0.12.0-dev.2341+92211135f
travisstaloch commented 9 months ago

this is my current 1 liner for switching to most recent local version.

alias zigup-latest="zigup $(zigup list 2>&1 | tail -1)"

seems to work but i don't know if zigup list is sorted in any way so i'm not sure if this is reliable.

marler8997 commented 9 months ago

What about zigup latest? Since it's not associated with git maybe that makes it a bit more intuitive that it won't fetch the latest version first?

travisstaloch commented 9 months ago

Yeah zigup latest sounds great. I don't really care too much about the command name, hopefully it ends up fairly easy to type.

Something i noticed about my zigup-latest bash alias is that i need to sort the output from zigup list since i noticed my latest zig version was appearing at the top of the list.

travisstaloch commented 9 months ago

I'd be willing to work on this feature, but I haven't looked at this project recently and would appreciate any guidance you might have related to how it should work.