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

Error: File not found when updating snapshot in src/main.zig #2

Open
jullanggit opened this issue Jan 5, 2025 · 0 comments
Open

Error: File not found when updating snapshot in src/main.zig #2

jullanggit opened this issue Jan 5, 2025 · 0 comments

Comments

@jullanggit
Copy link

jullanggit commented Jan 5, 2025

Disclaimer

Firstly, thank you for making ohsnap!
Secondly, I am pretty new to zig, so maybe I am just doing something wrong

Issue

When ohsnap tries to update a snapshot in src/main.zig, it gets an ENOENT.
This is most likely because @src returns the file relative to the root directory of its module (so in my case just main.zig), but ohsnap tries to find it in the cwd (the parent of src) and logically doesn't find it there.

Fix

I currently just symlink src/main.zig to main.zig, but ideally ohsnap would somehow get the root directory of the module and look for the file there.

Thank you for taking a look at this!

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

No branches or pull requests

1 participant