This repository has been archived on 2026-03-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
openclaw-extensions/wecom/node_modules/node-llama-cpp/dist/cli/utils/getReadablePath.js
T

14 lines
520 B
JavaScript

import os from "os";
import path from "path";
export function getReadablePath(fsPath) {
const resolvedPath = path.resolve(process.cwd(), fsPath);
if (process.platform === "win32" || process.platform === "cygwin")
return resolvedPath;
let homedir = os.homedir();
if (!homedir.endsWith("/"))
homedir += "/";
if (resolvedPath.startsWith(homedir))
return "~" + resolvedPath.slice(homedir.length - "/".length);
return resolvedPath;
}
//# sourceMappingURL=getReadablePath.js.map