-
Notifications
You must be signed in to change notification settings - Fork 533
Fix 'Creating Modules' code examples #1609
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
Conversation
7bee9ca
to
96beae9
Compare
Thanks |
@Kissaki Thanks! I'm glad you were able to work through the chapter and find these issues. Apologies for the first one - Definitely my copy/paste error there. On the second one, it was actually working "as intended" (but not quite well-enough, apparently). What I think must have happened is that you (at some point) imported it with: use my-utils/mod.nu * Maybe an extra Tab-complete too far picked up the If I'm correct, then this would have caused Importing with With your change, it now fails when properly imported - It doesn't error, but it returns the wrong directory (the parent of the module directory itself). But you've found an interesting issue, but at least one that I can work around with a change to check if the If you get a chance, can you (a) confirm my suspicions about |
I retested the code without the fixup in this MR, with various constellations, and I always get the error. Do you expect For me it makes sense that it never works because CURRENT_FILE is a file path, and cd change directory requires a directory path. Navigating into a file makes no sense. I changed it to With that context, I don't see how #1610 makes sense. If it's not |
While I'm still not sure why we are getting different results, I think the core problem goes back to this Nushell issue, but I still want to make sure. I thought the fix for that issue had made it in 0.99, but it appears it was reverted, so it's likely I'll need to find an entirely different example for that stage.
And given what you were/are seeing, that makes perfect sense!
In my testing, when a module is imported using directory-form, the It's possible there's more than one root issue here. |
Both errored when executed.