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

[Question] Possible to access environment variable in #load? #655

Closed
MostHated opened this issue Jan 26, 2022 · 1 comment
Closed

[Question] Possible to access environment variable in #load? #655

MostHated opened this issue Jan 26, 2022 · 1 comment
Labels

Comments

@MostHated
Copy link

MostHated commented Jan 26, 2022

Hey there,
I just had a quick question of if it might be at all possible to access environment variables within the #load portion of a script? I wanted to put some frequently used items within a folder in $HOME (~/.csx). I tried to see if I could use either of the following:

#load "~/.csx/shell.csx"
#load "$HOME/.csx/shell.csx"

It did not seem to like that. Is there a way to accomplish this, either by pulling an env var, or perhaps setting an external shared path config value somewhere that all scripts might be able to get to, or do I just have to hard code that path?

Thanks,
-MH

@filipw
Copy link
Member

filipw commented Jan 26, 2022

This is currently not possible. The path in the load directive is only resolved by dotnet-script if takes the #load "nuget:{package}, {version}" form and by the Roslyn compiler otherwise.

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

No branches or pull requests

2 participants