Replies: 2 comments 1 reply
-
Nickel wouldn't automatically do this expansion. But, you could write a Nickel function to do the expansion with the caveat that Nickel doesn't have a builtin to access environment variables:
and export to TOML using nickel export --format toml <<< "(import \"test.ncl\") & { HOME = \"$HOME\" }" You would then have to somehow arrange for this export to happen before calling anything that needs |
Beta Was this translation helpful? Give feedback.
1 reply
-
Ok thanks mate :)
------- Original Message -------
…On Tuesday, June 13th, 2023 at 18:01, Yann Hamdaoui ***@***.***> wrote:
I think it would be more idiomatic to simply interpolate HOME directly:
{
HOME
| String
| not_exported,
dependency = {
some_lib = {path = "%{HOME}/Desktop/some_lib"}
}
}
***@***.***(https://github.com/Raj2032), the idea is to write the config file in Nickel instead of TOML (Cargo.ncl), where you have access to string interpolation, functions, etc. Then export it as TOML.
—
Reply to this email directly, [view it on GitHub](#1356 (reply in thread)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AG7P2BSQ7ESPBR57X3RLZQ3XLAM7JANCNFSM6AAAAAAZCFTL3I).
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Lets say if I wanted something like this in my
Cargo.toml
file:This is obviously not valid as it can't convert
~
to/home/<username>/
.So I was wondering if I understood correctly, would Nickel solve such an issue and actually create a
Cargo.toml
file by figuring out what is the~
and then add this bit in:/Desktop/some_lib
into theCargo.toml
file?Beta Was this translation helpful? Give feedback.
All reactions