Skip to content

Support env variable substitution with defaults in rebar shell #2948

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

richcarl
Copy link
Contributor

@richcarl richcarl commented May 10, 2025

The sys.config.src file may since OTP 21 contain env variables with defaults using the standard shell syntax ${FOO:-some_default}. The only place where Rebar itself needs to worry about this is in the shell command which wants to load the sys.config, and must then perform the substitutions first. This commit implements support for such env variable defaults. Previously, Rebar would crash if it encountered this syntax.

By some simple refactoring, this also makes the rebar3 ct --sys_config option work on sys.config.src files.

richcarl added 4 commits May 10, 2025 11:44
The sys.config.src file may since OTP 21 contain env variables with
defaults using the standard shell syntax `${FOO:-some_default}`.  The
only place where Rebar itself needs to worry about this is in the
`shell` command which wants to load the sys.config, and must then
perform the substitutions first. This commit implements support for
such env variable defaults. Previously, Rebar would crash if it
encountered this syntax.
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

Successfully merging this pull request may close these issues.

1 participant