2020-03-29 16:52:46 +00:00
|
|
|
const { homedir } = require('os')
|
|
|
|
const { copyFileSync } = require('fs')
|
|
|
|
const { join, basename } = require('path')
|
2020-01-31 18:58:18 +00:00
|
|
|
|
|
|
|
const PUBLIC_DIR = join(__dirname, '..', 'public')
|
|
|
|
|
2020-03-29 16:52:46 +00:00
|
|
|
function moveToPublic (filepath) {
|
|
|
|
console.log(`[KawAnime] Copying ${filepath} to public directory.`)
|
2020-01-31 18:58:18 +00:00
|
|
|
|
2020-03-29 16:52:46 +00:00
|
|
|
copyFileSync(
|
|
|
|
filepath,
|
|
|
|
join(PUBLIC_DIR, basename(filepath))
|
|
|
|
)
|
|
|
|
}
|
2020-01-31 18:58:18 +00:00
|
|
|
|
2020-03-29 16:52:46 +00:00
|
|
|
function linux () {
|
|
|
|
// TODO
|
|
|
|
}
|
2020-01-31 18:58:18 +00:00
|
|
|
|
2020-03-29 16:52:46 +00:00
|
|
|
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()
|