Skip to content

Conversation

@Grazfather
Copy link
Contributor

I typod a version and noticed that zigup aborted.

This might be just a tiny bit nicer

Before

❯ ./zig-out/bin/zigup 0.1.00
install directory '/Users/g/.local/share/zigup'
mkdir -p '/Users/g/.local/share/zigup'
thread 38496615 panic: invalid version '0.1.00'
Unable to dump stack trace: debug info stripped
Abort trap: 6

After

❯ ./zig-out/bin/zigup 0.1.00
install directory '/Users/g/.local/share/zigup'
mkdir -p '/Users/g/.local/share/zigup'
error: InvalidVersion

@marler8997
Copy link
Owner

I agree this can be improved, I'm not sure I prefer not printing the version in the resulting error message.

@Grazfather
Copy link
Contributor Author

I figured it's basically right there on the cli, but I could have it log and return if that's what you prefer.

@marler8997
Copy link
Owner

marler8997 commented May 26, 2025

I pushed a commit, does this solution work for you?

zig-out\bin\zigup foo
install directory 'C:\git\zigup\zig-out\bin\zig'
mkdir "C:\git\zigup\zig-out\bin\zig"
error: invalid zig version 'foo', unable to create a download URL for it

@Grazfather
Copy link
Contributor Author

Yep looks good to me! I just thought an abort was a little ugly.

@marler8997 marler8997 merged commit 5edfb8a into marler8997:master May 26, 2025
3 checks passed
@Grazfather Grazfather deleted the dont_panic branch May 26, 2025 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants