wren-cli
wren-cli copied to clipboard
Trouble with modules
I've just downloaded wren (hi!), but I can't get any modules to load:
Could not load module 'E:\E:/downloads/misc/wren/wren_cli-windows-0.3.0/pattern'.
Where I'm using import "/pattern" for Pattern and the pattern.wren off rosettacode. It does not matter where I put it, it ain't ever getting past that "E:\E:/" (as proved with procmon). Running on windows 10
Pete
Currently, modules are loaded from a "wren_modules" directory from the first parent directory, relative to PWD or script path (I don't remember exactly).
Yep, already tried that. If I change the first line to import "pattern" for Pattern, and create \wren_modules\pattern\pattern.wren (just in case), it still fails this time just saying Could not load module 'pattern'. and procmon identifies the actual error as:
E:\E:\downloads\misc\wren\wren_cli-windows-0.3.0\wren_modules\pattern\pattern.wren
I also tried import "\\pattern" for Pattern, and the error just goes back to "E:\E:/".
I don't have windows to test it easily, it might be there is a problem in path somehow seeing that the drive is duplicated.
Ah! It works when in the same directory, but not elsewhere.
In other words if pwd yields E:\downloads\misc\wren\wren_cli-windows-0.3.0 and I run wren_cli-0.3.0.exe test.wren, but not for E:\downloads\misc\wren\wren_cli-windows-0.3.0\wren_cli-0.3.0.exe E:\downloads\misc\wren\wren_cli-windows-0.3.0\test.wren
In fact the latter command does not work even when I am in the right directory.
Probably a platform issue, windows has an odd notion of pwd of execution...
OK, this is now the lowest possible priority, but next time you get a chance, it really shouldn't mangle path names like that. Cheers.
As this is a CLI issue, it has been moved to the CLI repo.
@petelomax Can you confirm you still have an issue on the latest code? (we just bumped to 0.4.0)
Sorry, there is no release as yet for me to test at https://github.com/wren-lang/wren-cli/releases The latest build there is still from June 5th 2020 (I'm a bit backward that way!)