A structured-data shell in Gleam, inspired by Nushell
0

Configure Feed

Select the types of activity you want to include in your feed.

gleshell / src / gleshell / sys.gleam
855 B 28 lines
1//// OS / process FFI wrappers. 2 3@external(erlang, "gleshell_ffi", "get_line") 4pub fn get_line(prompt: String) -> Result(String, String) 5 6@external(erlang, "gleshell_ffi", "set_cwd") 7pub fn set_cwd(path: String) -> Result(Nil, String) 8 9@external(erlang, "gleshell_ffi", "get_cwd") 10pub fn get_cwd() -> Result(String, String) 11 12@external(erlang, "gleshell_ffi", "getenv") 13pub fn getenv(name: String) -> Result(String, Nil) 14 15@external(erlang, "gleshell_ffi", "setenv") 16pub fn setenv(name: String, value: String) -> Result(Nil, Nil) 17 18@external(erlang, "gleshell_ffi", "run_cmd") 19pub fn run_cmd( 20 command: String, 21 args: List(String), 22) -> Result(#(Int, String), String) 23 24@external(erlang, "gleshell_ffi", "which") 25pub fn which(command: String) -> Result(String, Nil) 26 27@external(erlang, "gleshell_ffi", "home_dir") 28pub fn home_dir() -> Result(String, String)