rcl
rcl copied to clipboard
Exporting to env format
It would be nice to create a Record and have the output be type specific. Eg.
type Person = {
name: String,
age: Int,
};
let john: Person = {
name: "John Doe",
age: 99,
};
output:
NAME="John Doe"
AGE=99
AFAIK, environment variables are always text. I'd expect the following output to be equivalent
NAME=John Doe
AGE="99"
Where are you passing the output to and do you actually get errors with my output?
side note: your snippet is missing the type annotation (Person)
let john: Person = { ...
maybe an "unused type" warning would be a good thing
@denfren I'm passing the output to Taskfile . Your example doesn't cause any errors.
I'm looking for the formatting. The .env formatting would make sure to:
- automatically uppercase variable name:
NAME=...instead ofname=... - trim white space between variable name and value:
NAME=...instead ofNAME = ... - give visual cues about variable type:
NAME="..."instead ofNAME=...forString, and no quotes forIntorBool