Skip to content

Commit

Permalink
fix: don't include piped input in template by default (#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
reubenmiller authored Mar 27, 2023
1 parent 4e6fafe commit 2c0f2aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/cmd/template/execute/execute.manual.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Pass external json data into the template, and reference it via the "input.value
cmd,
flags.WithData(),
f.WithTemplateFlag(cmd),
flags.WithExtendedPipelineSupport("input", "input", false),
flags.WithExtendedPipelineSupport("input", "", false),
)

cmdutil.DisableAuthCheck(cmd)
Expand Down
8 changes: 8 additions & 0 deletions tests/manual/template/template_execute.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/reubenmiller/commander/feat/handle-nested-files/schema.json

tests:
It does not include piped input without referencing it:
command: |
echo "1" | c8y template execute --template "{}"
exit-code: 0
stdout:
exactly: |
{}
It preserves double quotes in bash/zsh:
command: |
c8y template execute --template "{\"email\": \"he llo@ex ample.com\"}"
Expand Down

0 comments on commit 2c0f2aa

Please sign in to comment.