Skip to content

Request: Execute Commands in Templates #8

@bradennapier

Description

@bradennapier

I have run into a few situations where it would be very helpful to allow executing of a command rather than substitution of a variable when running a template (with the ability to use variables if possible. I can of course set the variables before running the template, but in situations where I use the template from multiple procedures and need to update a value it definitely will be greatly beneficial to have.

I was thinking if there is a worry about substituting the commands directly that perhaps appending C could mean that it should also run any commands in the string? I could of course create all those situations where I just have a variable to directly reference but there are often times that ends up running into some messy situations, especially since many times i want to reference something that is not stored as a directly accessible variable.

Just a thought, obviously easy enough to work around it - just feel it kind of fits into the concept.

{
    "authToken": "~SC:[authToken]",
    "localTimestamp": "~NC:[clock milliseconds]",
    "payload": "~TC:[dict get $::JSON::Templates $request]"
 }

Obviously this also opens some other interesting capabilities like generating templates through return values of commands, etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions