Skip to content

Conversation

@mirror-shades
Copy link
Contributor

When a user tries to download a version using semantics like this: 'zig 0.14.0', it downloads the release and then attempts to run the release without any arguments. This change assumes that the user intended to do this and exits rather than returns Zigs "no commands" error.

Notes:

  • This change only applies to downloading, running 'zig 0.14.0' will still return Zigs "no commands" error if the release is already installed.

@marler8997
Copy link
Owner

I'm unsure of the use case to warrant this extra code that would otherwise be unnecessary?

@mirror-shades
Copy link
Contributor Author

From my usage it just feels wrong to receive an error after successfully downloading a release, but there is no specific value to the code outside of this

@marler8997
Copy link
Owner

Ah well, this would be diverging from what the underlying "zig" executable does. For the most part, I think anyzig should behave exactly as zig would unless there's good reason to diverge. So, zig VERSION should do whatever zig does.

@mirror-shades
Copy link
Contributor Author

mirror-shades commented May 24, 2025

This is only regarding the downloading of new versions, which isn't functionality included in the underlying Zig executable. Passing zig 0.14.0 directly to the Zig executable results in "error: unknown command: 0.14.0", so strictly speaking it already diverges from the underlying Zig executable behavior here.

Maybe downloading a new version should be added under the zig any modifer? so zig any 0.14.0 to download a release rather than zig 0.14.0? At least in that case it would be more obvious that the functionality being accessed comes from anyzig not the zig exe.

@marler8997
Copy link
Owner

Maybe downloading a new version should be added under the zig any modifer? so zig any 0.14.0 to download a release rather than zig 0.14.0? At least in that case it would be more obvious that the functionality being accessed comes from anyzig not the zig exe.

Yeah that seems reasonable.

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