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

Can import_code have an absolute path? #104

Open
Crater44 opened this issue Aug 15, 2023 · 2 comments
Open

Can import_code have an absolute path? #104

Crater44 opened this issue Aug 15, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@Crater44
Copy link
Contributor

It would be great to be able to import code like import_code('~/some/path') with a symbol like ~ or using / in the first character to get the root path of the project so I don't have to be looking backwards with double dots, also it would be great if it could be configured like using ~ for root path and @ to import from, for example, a vendor folder.

@ayecue
Copy link
Owner

ayecue commented Aug 15, 2023

Thanks for the suggestion. I'll take a look on how much effort this will be as soon as I have time.

@ayecue ayecue added the enhancement New feature or request label Aug 15, 2023
@ayecue
Copy link
Owner

ayecue commented Aug 17, 2023

Okay I've looked into this. The issue is that with how greybel is designed right now it has no way of knowing what the root directory should be. I mean I could always take the current pwd environment variable as the root but I think this will properly lead to confusion.

To add this feature I would probably need to add some kind of root configuration file. Something like in node where you have a package.json.

Anyway this may take some time to implement since I need to decide on a good structure for the configuration file and I also need to add some kind of init command to greybel to create some basic configuration file for the user. It is still a good suggestion though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants