First upload version 0.0.1
This commit is contained in:
14
node_modules/node-llama-cpp/dist/cli/utils/getReadablePath.js
generated
vendored
Normal file
14
node_modules/node-llama-cpp/dist/cli/utils/getReadablePath.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
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
|
||||
Reference in New Issue
Block a user