Skip to content

Commit

Permalink
internal: add get env vars ffi in moonrun (#470)
Browse files Browse the repository at this point in the history
  • Loading branch information
Young-Flash authored Nov 12, 2024
1 parent c9181d0 commit 512d177
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions crates/moonrun/src/sys_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,18 @@ const INIT_SYS_API: &str = r#"
return run_env.args
}
function env_get_vars() {
let result = []
for (let [key, value] of run_env.env_vars) {
result.push(key)
result.push(value)
}
return result
}
obj.env_get_var = env_get_var
obj.args_get = args_get
obj.env_get_vars = env_get_vars
})()
"#;

Expand Down

0 comments on commit 512d177

Please sign in to comment.