Buckets:
| import whichPkg from "which" | |
| import path from "path" | |
| import { Global } from "../global" | |
| export function which(cmd: string, env?: NodeJS.ProcessEnv) { | |
| const base = env?.PATH ?? env?.Path ?? process.env.PATH ?? process.env.Path ?? "" | |
| const full = base ? base + path.delimiter + Global.Path.bin : Global.Path.bin | |
| const result = whichPkg.sync(cmd, { | |
| nothrow: true, | |
| path: full, | |
| pathExt: env?.PATHEXT ?? env?.PathExt ?? process.env.PATHEXT ?? process.env.PathExt, | |
| }) | |
| return typeof result === "string" ? result : null | |
| } | |
Xet Storage Details
- Size:
- 536 Bytes
- Xet hash:
- 68c034ac508074eab13efa43e483666fb2f4d6d8e3f08a9bb1851e52d9efe3e3
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.