Skip to content

Commit e08304d

Browse files
committed
Allow for non-string values in exec-env
This was previously forbidden for some reason, however if the value is not a complex type there should be no issues. Signed-off-by: billy4479 <giachi.ellero@gmail.com>
1 parent ba01042 commit e08304d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cmd/sops/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import (
4040
"github.com/getsops/sops/v3/kms"
4141
"github.com/getsops/sops/v3/logging"
4242
"github.com/getsops/sops/v3/pgp"
43+
"github.com/getsops/sops/v3/stores"
4344
"github.com/getsops/sops/v3/stores/dotenv"
4445
"github.com/getsops/sops/v3/stores/json"
4546
"github.com/getsops/sops/v3/version"
@@ -255,7 +256,7 @@ func main() {
255256
}
256257
value, ok := item.Value.(string)
257258
if !ok {
258-
return cli.NewExitError(fmt.Errorf("cannot use non-string values in environment, got %T", item.Value), codes.ErrorGeneric)
259+
value = stores.ValToString(item.Value)
259260
}
260261
env = append(env, fmt.Sprintf("%s=%s", key, value))
261262
}

0 commit comments

Comments
 (0)