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

Providing helpers by exported shell functions #3

Open
olorin37 opened this issue Dec 31, 2019 · 1 comment
Open

Providing helpers by exported shell functions #3

olorin37 opened this issue Dec 31, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@olorin37
Copy link
Owner

olorin37 commented Dec 31, 2019

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.

@olorin37 olorin37 added the enhancement New feature or request label Jan 7, 2020
@olorin37 olorin37 changed the title Lambdas by exported shell functions Providing helpers by exported shell functions Jan 8, 2020
@olorin37
Copy link
Owner Author

olorin37 commented Jan 24, 2020

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
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant