135 lines
1.7 KiB
JavaScript
135 lines
1.7 KiB
JavaScript
|
|
|
||
|
|
|
||
|
|
import os from 'node:os';
|
||
|
|
//var os = require('node:os');
|
||
|
|
var platform = process.platform;
|
||
|
|
|
||
|
|
var version = process.versions.modules;
|
||
|
|
|
||
|
|
var architecture = process.arch;
|
||
|
|
|
||
|
|
var betterSqliteVersion = "8.1.0";
|
||
|
|
|
||
|
|
//console.log( platform );
|
||
|
|
|
||
|
|
//console.log( version );
|
||
|
|
|
||
|
|
//console.log( architecture );
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
var filename = "better-sqlite3-v"+ betterSqliteVersion +"-node-v" + version + "-" + platform + "-" + architecture + ".tar.gz";
|
||
|
|
|
||
|
|
var cpuCore = os.cpus();
|
||
|
|
|
||
|
|
let isApple = cpuCore[0].model.toLowerCase().includes("apple")
|
||
|
|
|
||
|
|
let isAmd = cpuCore[0].model.toLowerCase().includes("amd")
|
||
|
|
|
||
|
|
let isIntel = cpuCore[0].model.toLowerCase().includes("intel")
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
if( isAmd ) {
|
||
|
|
|
||
|
|
switch( architecture ) {
|
||
|
|
|
||
|
|
case "x64":
|
||
|
|
|
||
|
|
var es_architecture = "amd64"
|
||
|
|
|
||
|
|
break
|
||
|
|
|
||
|
|
case "arm":
|
||
|
|
|
||
|
|
var es_architecture = "arm"
|
||
|
|
|
||
|
|
break
|
||
|
|
|
||
|
|
case "ia32":
|
||
|
|
|
||
|
|
var es_architecture = "386"
|
||
|
|
|
||
|
|
break;
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
if( isIntel ) {
|
||
|
|
|
||
|
|
switch( architecture ) {
|
||
|
|
|
||
|
|
case "x64":
|
||
|
|
|
||
|
|
var es_architecture = "amd64"
|
||
|
|
|
||
|
|
break
|
||
|
|
|
||
|
|
case "arm":
|
||
|
|
|
||
|
|
var es_architecture = "arm"
|
||
|
|
|
||
|
|
break
|
||
|
|
|
||
|
|
case "ia32":
|
||
|
|
|
||
|
|
var es_architecture = "386"
|
||
|
|
|
||
|
|
break;
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
if( isApple ) {
|
||
|
|
|
||
|
|
switch( architecture ) {
|
||
|
|
|
||
|
|
case "x64":
|
||
|
|
|
||
|
|
var es_architecture = "amd64"
|
||
|
|
|
||
|
|
break
|
||
|
|
|
||
|
|
case "arm":
|
||
|
|
|
||
|
|
var es_architecture = "arm"
|
||
|
|
|
||
|
|
break
|
||
|
|
|
||
|
|
case "ia32":
|
||
|
|
|
||
|
|
var es_architecture = "386"
|
||
|
|
|
||
|
|
break;
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
if( platform == "win32" ) {
|
||
|
|
|
||
|
|
var extensions = ".exe";
|
||
|
|
|
||
|
|
platform = "windows"
|
||
|
|
|
||
|
|
} else {
|
||
|
|
|
||
|
|
var extensions = "";
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
var path = "./framework/node_modules/esbuild/";
|
||
|
|
|
||
|
|
var binaryFilename = platform + "_" + es_architecture + extensions;
|
||
|
|
|
||
|
|
//var loadedModule = require("./linux_amd64");
|
||
|
|
|
||
|
|
export default path + binaryFilename;
|
||
|
|
|
||
|
|
//better-sqlite3-v8.1.0-node-v108-linux-x64.tar.gz
|
||
|
|
|
||
|
|
//better-sqlite3-v8.1.0-node-v108-linux-x64.tar.gz
|