Skip to content

Commit

Permalink
fix(andax/fns/io): make fns global
Browse files Browse the repository at this point in the history
  • Loading branch information
madonuko committed Sep 19, 2023
1 parent e2157fb commit 3c2d784
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions andax/src/fns/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,17 @@ type T = Result<(i32, String, String), Box<EvalAltResult>>;
#[export_module]
pub mod ar {
/// get the return code from the return value of `sh()`
#[rhai_fn(global)]
pub fn sh_rc(o: (i32, String, String)) -> i32 {
o.0
}
/// get stdout from the return value of `sh()`
#[rhai_fn(global)]
pub fn sh_stdout(o: (i32, String, String)) -> String {
o.1
}
/// get stderr from the return value of `sh()`
#[rhai_fn(global)]
pub fn sh_stderr(o: (i32, String, String)) -> String {
o.2
}
Expand Down

0 comments on commit 3c2d784

Please sign in to comment.