Download packages/tui/src/runtime.tsx from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 337 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/tui/src/runtime.tsx
- Command line
-
hf download hf://SaylorTwift/opencode/packages/tui/src/runtime.tsx
-
curl -L -o runtime.tsx https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/tui/src/runtime.tsx
337 Bytes
| import path from "path" | |
| export function abbreviateHome(input: string, home: string) { | |
| if (!home) return input | |
| const relative = path.relative(home, input) | |
| if (relative === "") return "~" | |
| if (relative === ".." || relative.startsWith(".." + path.sep) || path.isAbsolute(relative)) return input | |
| return "~" + path.sep + relative | |
| } | |