Skip to content

Providing helpers by exported shell functions #3

Open

Description

@olorin37

As this is a handlebars CLI it would be useful to make possible defining helpers for handlebars via shell function export - which would in fact mean using any program to decorate values.

Activity

  1. changed the title [-]Lambdas by exported shell functions[/-] [+]Providing helpers by exported shell functions[/+] on Jan 8, 2020
  2. olorin37 commented on Jan 24, 2020

    @olorin37
    OwnerAuthor

    rs:

    use std::process::Command;
    use std::str;
    
    fn main() {
        let prc = Command::new("bash").args( &["-c", "exp_fun"]).output();
        match prc {
            Ok( o ) => println!("OK: A{}Z", str::from_utf8(&o.stdout).unwrap()),
            Err( _ ) => println!("Nope"),
        }
    }

    usage:

    exp_fun() { echo -n "---> $1 <---"; }; export -f exp_fun ; ./r 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions