Packages

A browser automation tool and interface to the Chrome DevTools Protocol.

Current section

Files

Jump to
chrobot_extra src chrobot_extra internal os.gleam
Raw

src/chrobot_extra/internal/os.gleam

/// OS family type representing the major operating system categories
pub type OsFamily {
Darwin
Linux
WindowsNt
FreeBsd
Other
}
/// Get the current operating system family
pub fn family() -> OsFamily {
case get_os_type() {
#("unix", "darwin") -> Darwin
#("unix", "linux") -> Linux
#("unix", "freebsd") -> FreeBsd
#("win32", _) -> WindowsNt
_ -> Other
}
}
@external(erlang, "chrobot_extra_ffi", "get_os_type")
fn get_os_type() -> #(String, String)