Skip to content
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

FIX/cli/use.go: initial symlink to ~/.zvm/bin is never created #75

Merged
merged 1 commit into from
Apr 11, 2024

Conversation

guidoschmidt
Copy link
Contributor

👋🏽 hello again 🙃

just tested the latest version (v0.6.5) on Windows and found a last small issue: if you didn't had the ~/.zvm/bin Symlink before, the current version early returns with an error:

Steps to reproduce:

F:\git\zig\zvm [master1 +2 ~0 -0 !]> zvm version
zvm v0.6.5 windows/amd64



F:\git\zig\zvm [master1 +2 ~0 -0 !]> ls ~\.zvm

    Directory: C:\Users\gs\.zvm

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----          11/04/2024    15:57                0.11.0
d----          11/04/2024    15:56                master
d----          11/04/2024    23:06                self
d----          11/04/2024    15:56                zig-windows-x86_64-0.12.0-dev.3632+7fb5a0b18
-a---          11/04/2024    15:56             88 settings.json
-a---          11/04/2024    15:57          37606 versions.json




F:\git\zig\zvm [master1 +2 ~0 -0 !]> zvm use master
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x30 pc=0x126b95c]

goroutine 1 [running]:
github.com/tristanisham/zvm/cli.(*ZVM).setBin(0xc000068700, {0xc00000a0f0?, 0xc000018440?})
        github.com/tristanisham/zvm/cli/use.go:52 +0xfc
github.com/tristanisham/zvm/cli.(*ZVM).Use(0xc000068700, {0xc00000a0f0, 0x6})
        github.com/tristanisham/zvm/cli/use.go:34 +0x16d
main.main()
        github.com/tristanisham/zvm/main.go:122 +0xa15
F:\git\zig\zvm [master1 +2 ~0 -0 !]>

Simple fix

Just added a check if stat is nil. Everything else works like a charm 🙏🏼

@tristanisham tristanisham merged commit ca38ee3 into tristanisham:master Apr 11, 2024
1 check passed
@tristanisham tristanisham self-assigned this Apr 11, 2024
@tristanisham
Copy link
Owner

Awesome, @guidoschmidt. Have I told you you're a king? Thank you for all the awesome PRs and contributions this week. Pretty sure you've directly or indirectly contributed to closing half the issues with ZVM on Windows.

@guidoschmidt
Copy link
Contributor Author

@tristanisham thank you, I had a very strong motivation: I want to use zvm on my Windows machine 😇 glad I could help even without much Go experience

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