feat: add windows platform support for node file detection and npm package download
This commit is contained in:
parent
7d54f9b4fa
commit
8687985ccb
@ -26,6 +26,11 @@ exports.default = async function (context) {
|
|||||||
const _arch = arch === Arch.arm64 ? ['linux-arm64-gnu', 'linux-arm64-musl'] : ['linux-x64-gnu', 'linux-x64-musl']
|
const _arch = arch === Arch.arm64 ? ['linux-arm64-gnu', 'linux-arm64-musl'] : ['linux-x64-gnu', 'linux-x64-musl']
|
||||||
removeDifferentArchNodeFiles(node_modules_path, '@libsql', _arch)
|
removeDifferentArchNodeFiles(node_modules_path, '@libsql', _arch)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (platform === 'windows') {
|
||||||
|
const node_modules_path = path.join(context.appOutDir, 'resources', 'app.asar.unpacked', 'node_modules')
|
||||||
|
removeDifferentArchNodeFiles(node_modules_path, '@libsql', ['win32-x64-msvc'])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeDifferentArchNodeFiles(nodeModulesPath, packageName, arch) {
|
function removeDifferentArchNodeFiles(nodeModulesPath, packageName, arch) {
|
||||||
|
|||||||
@ -27,6 +27,13 @@ async function downloadNpm(platform) {
|
|||||||
'https://registry.npmjs.org/@libsql/linux-x64-musl/-/linux-x64-musl-0.4.7.tgz'
|
'https://registry.npmjs.org/@libsql/linux-x64-musl/-/linux-x64-musl-0.4.7.tgz'
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!platform || platform === 'windows') {
|
||||||
|
downloadNpmPackage(
|
||||||
|
'@libsql/win32-x64-msvc',
|
||||||
|
'https://registry.npmjs.org/@libsql/win32-x64-msvc/-/win32-x64-msvc-0.4.7.tgz'
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const platformArg = process.argv[2]
|
const platformArg = process.argv[2]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user