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

feature-request: allow referencing environment variables using configurable set of prefixes #373

Open
dikderoy opened this issue Mar 10, 2023 · 0 comments

Comments

@dikderoy
Copy link

dikderoy commented Mar 10, 2023

Hi there.

I would love it if spruce could refer to env variables using not only $VAR_NAME but also other prefixes (which could be fixed or passed as an option from CMD.

Use-case:

I use spruce extensively on CI environments to produce configurations dynamically.

In cases when spruce configurations are passed around inside CI, it is not always possible to disable variable expansion. Sometimes I even want some parts to be expanded while others should remain unexpanded - specifically spruce operators like (( grab $VAR_NAME )).

If it would be possible to define alternative prefixes that would not trigger shell expansion by themselves, it would've been great!

So ideally I would want to see an option to define a list of prefixes to use like:

spruce --env-prefixes="%,$,@" ... 

or just support for alternative prefixes - % and @ as potential options.

so that following spruce operators perform identically:

data1: ((grab $VAR_NAME))
data2: ((grab %VAR_NAME))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant