Download packages/tui/src/util/system.ts from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 677 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/tui/src/util/system.ts
- Command line
-
hf download hf://SaylorTwift/opencode/packages/tui/src/util/system.ts
-
curl -L -o system.ts https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/tui/src/util/system.ts
677 Bytes
| import { release } from "node:os" | |
| export function describeOS() { | |
| const name = | |
| process.platform === "darwin" | |
| ? "macOS" | |
| : process.platform === "win32" | |
| ? "Windows" | |
| : process.platform === "linux" | |
| ? "Linux" | |
| : process.platform | |
| return `${name} ${release()} (${process.arch})` | |
| } | |
| export function describeTerminal() { | |
| const program = process.env.TERM_PROGRAM || process.env.TERM || "unknown" | |
| const version = process.env.TERM_PROGRAM_VERSION ? ` ${process.env.TERM_PROGRAM_VERSION}` : "" | |
| const multiplexer = process.env.TMUX ? " in tmux" : process.env.STY ? " in screen" : "" | |
| return `${program}${version}${multiplexer}` | |
| } | |