Download packages/tui/src/util/path.ts from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 346 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/tui/src/util/path.ts
- Command line
-
hf download hf://SaylorTwift/opencode/packages/tui/src/util/path.ts
-
curl -L -o path.ts https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/tui/src/util/path.ts
346 Bytes
| import { realpathSync } from "node:fs" | |
| import { win32 } from "node:path" | |
| export function normalizePath(input: string, platform: string) { | |
| if (platform !== "win32") return input | |
| const resolved = win32.normalize(win32.resolve(input.replaceAll("/", "\\"))) | |
| try { | |
| return realpathSync.native(resolved) | |
| } catch { | |
| return resolved | |
| } | |
| } | |