KawAnime/scripts/moveLibs.js

32 lines
697 B
JavaScript
Raw Normal View History

const { homedir } = require('os')
const { copyFileSync } = require('fs')
const { join, basename } = require('path')
const PUBLIC_DIR = join(__dirname, '..', 'public')
function moveToPublic (filepath) {
console.log(`[KawAnime] Copying ${filepath} to public directory.`)
copyFileSync(
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()