-
Notifications
You must be signed in to change notification settings - Fork 30
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
[RFC] ~/.wren directory #78
Comments
I'd suggest // loads ~/.wren/lib/mywrencode.wren
import "mywrencode" for MyStuff I'm not sure we need to redefine what |
We currently have 3 path types:
I propose:
import "#os" for System, Time The second suggestion is probably simpler (no specific chars) without getting into |
Also perhaps a |
I like the idea. Redefining home seems weird to do. For the lib directory I would not force it since you will loose access to the config files. One solution would be to first check if the file exists in home. If not then check home/lib before aborting import |
How so? They can live in |
I don't have an specific use case. And since Wren does not have json support is easier to create config files that contains Wren objects. |
@clsource Are you aware of the existing |
I didn´t know much about them either. But since they are available. Can be a directory called wren_modules inside the wren directory. So in the root wren directory you could store non module files and in wren_modules, you can use it for storing wren modules 👍 |
Ok... so Then (assuming there were no other wren_modules): // wren_modules is resolved to ~/.wren/modules/
import "booger" // => ~/.wren/modules/booger/booger.wren (existing CLI behavior)
import "booger/sugar" // => ~/.wren/modules/booger/sugar.wren (existing CLI behavior) So the question is what happens if there is already another
The whole idea of non-modules kind of bugs me still... I feel like if you just want to get a single file why not just load it directly (no magic): import "~/.wren/config"
// or
import "%(WREN_HOME)/config" And the CLI would inject Thoughts? |
FYI: I do think you need both... since you might have a large project with it's own |
I am closing this since #114 is a better scope to this :) |
Having a
.wren
directory inhome
(%AppData% in Windows) can be useful for configuration files and custom code extensions (both in wren files and if implemented in the possibleffi
plugins).Inside Wren files one can use this format
import "~/mywrencode" for WrenCode
import "~/utils/env" for Env
That could be translated to
import "/usr/home/myuser/.wren/mywrencode" for WrenCode
import "/usr/home/myuser/.wren/utils/env" for Env
A simple tree structure can be the following
Related
The text was updated successfully, but these errors were encountered: