First upload version 0.0.1
This commit is contained in:
28
node_modules/node-llama-cpp/dist/bindings/utils/getPlatformInfo.js
generated
vendored
Normal file
28
node_modules/node-llama-cpp/dist/bindings/utils/getPlatformInfo.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
import os from "os";
|
||||
import { getPlatform } from "./getPlatform.js";
|
||||
import { getLinuxDistroInfo } from "./getLinuxDistroInfo.js";
|
||||
export async function getPlatformInfo() {
|
||||
const currentPlatform = getPlatform();
|
||||
if (currentPlatform === "mac")
|
||||
return {
|
||||
name: "macOS",
|
||||
version: os.release()
|
||||
};
|
||||
else if (currentPlatform === "linux") {
|
||||
const linuxDistroInfo = await getLinuxDistroInfo();
|
||||
return {
|
||||
name: linuxDistroInfo.name,
|
||||
version: linuxDistroInfo.version
|
||||
};
|
||||
}
|
||||
else if (currentPlatform === "win")
|
||||
return {
|
||||
name: "Windows",
|
||||
version: os.release()
|
||||
};
|
||||
return {
|
||||
name: "Unknown",
|
||||
version: os.release()
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=getPlatformInfo.js.map
|
||||
Reference in New Issue
Block a user