GoogleCloudPlatform / GoogleCloudPlatform/cloud-builders-community

[Feature request] envsubst: support passing -s multiple times

Open
#633 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.3k
Forks
848
PR merge metrics
No merged PRs in 30d

Description

## Affected builder image

`gcr.io/cloud-builders-community/envsubst`

## Expected Behavior

When passing `-s` multiple times, only the last one is applied.

## Actual Behavior

Accumulate the env vars to substitute and apply the substitution for them all.

## Steps to Reproduce the Problem

```sh
mkdir /tmp/test123 && cd /tmp/test123
wget 'https://github.com/GoogleCloudPlatform/cloud-builders-community/raw/master/envsubst/entrypoint.bash'
echo '$A $B $C' > to_sub
export A=Hello
export B=World
export C=":)"
bash entrypoint.bash -s '$A' -s '$B' -s '$C' to_sub
cat to_sub
```
output: `$A $B :)`

## Additional Info

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.