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

fix: process template variables in raw input #1157

Merged
merged 3 commits into from
Nov 24, 2024

Conversation

mattjoyce
Copy link
Contributor

Process template variables ({{var}}) consistently in both pattern files and raw input messages. Previously variables were only processed when using pattern files.

  • Add template variable processing for raw input in BuildSession
  • Initialize messageContent explicitly
  • Remove errantly committed build artifact (fabric binary in previous commit)

This will now support inline macros, with missing var checks.
echo 'Hello {{name}}' | ./fabric -v=name:World

Process template variables ({{var}}) consistently in both pattern files
and raw input messages. Previously variables were only processed when
using pattern files.

- Add template variable processing for raw input in BuildSession
- Initialize messageContent explicitly
- Remove errantly committed build artifact (fabric binary in previous commit)
echo 'Hello {{name}}' | ./fabric -v=noname:World
missing required variable: name
…ed in pattern

	streamlined some context staging
@eugeis eugeis merged commit 4ed512b into danielmiessler:main Nov 24, 2024
1 check passed
@ksylvan
Copy link
Contributor

ksylvan commented Dec 9, 2024

@mattjoyce Please provide a way to turn off this new behavior (preferably make it so you have to turn it on with a new flag, like --use-templates)

It's a great feature, but it breaks existing workflows where you're feeding files (or snippets of files, like diffs) that use Go templates or Jinja2 format; e.g Ansible Playbooks.

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.

3 participants