mirror of https://github.com/Kylart/KawAnime.git
Can now ship windows build with libssl and libcrypto 1.1
This commit is contained in:
parent
d767e52138
commit
c8644f5dbf
|
@ -38,5 +38,6 @@ bindings/build
|
|||
|
||||
# External libs binaries
|
||||
public/*.dylib
|
||||
public/*.dll
|
||||
public/mpv/*
|
||||
!public/mpv/.gitkeep
|
|
@ -1,22 +1,31 @@
|
|||
const { readdirSync, copyFileSync } = require('fs')
|
||||
const { join } = require('path')
|
||||
const { homedir } = require('os')
|
||||
const { copyFileSync } = require('fs')
|
||||
const { join, basename } = require('path')
|
||||
|
||||
const PUBLIC_DIR = join(__dirname, '..', 'public')
|
||||
const BINDINGS_BUILD_DIR = join(__dirname, '..', 'bindings', 'build', 'Release')
|
||||
|
||||
const FILE_NAME = {
|
||||
darwin: 'libtorrent-rasterbar.10.dylib',
|
||||
win32: 'libtorrent-rasterbar.dll'
|
||||
}[process.platform] || 'libtorrent-rasterbar.so'
|
||||
|
||||
readdirSync(BINDINGS_BUILD_DIR)
|
||||
.forEach((file) => {
|
||||
if (file !== FILE_NAME) return
|
||||
|
||||
console.log(`[KawAnime] Moving ${file} to public directory.`)
|
||||
function moveToPublic (filepath) {
|
||||
console.log(`[KawAnime] Copying ${filepath} to public directory.`)
|
||||
|
||||
copyFileSync(
|
||||
join(BINDINGS_BUILD_DIR, file),
|
||||
join(PUBLIC_DIR, file)
|
||||
filepath,
|
||||
join(PUBLIC_DIR, basename(filepath))
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
function linux () {
|
||||
// TODO
|
||||
}
|
||||
|
||||
function windows () {
|
||||
const sys32Path = join(homedir().split('\\')[0], 'Windows', 'System32')
|
||||
const requiredDlls = [
|
||||
'libcrypto-1_1-x64.dll',
|
||||
'libssl-1_1-x64.dll'
|
||||
].map((dll) => join(sys32Path, dll))
|
||||
|
||||
requiredDlls.forEach(moveToPublic)
|
||||
}
|
||||
|
||||
if (process.platform === 'win32') windows()
|
||||
else linux()
|
||||
|
|
Loading…
Reference in New Issue