Fix lib import for linux platforms

This commit is contained in:
Kylart 2020-04-13 21:47:38 +02:00
parent 3c0ccf047f
commit 74463bb0f1
1 changed files with 19 additions and 19 deletions

View File

@ -3,6 +3,7 @@ const { join } = require('path')
const IS_LINUX = !['win32', 'darwin'].includes(process.platform)
if (!IS_LINUX) {
const baseDir = ({
'darwin': '/usr/local/lib',
'win32': 'C:\\Windows\\system32'
@ -15,9 +16,7 @@ const libFilename = ({
const libPath = join(baseDir, libFilename)
if (IS_LINUX) {
console.log('KawANime [PostInstall] -- Linux platform detected, no need to move any library')
} else if (!existsSync(libPath)) {
if (!existsSync(libPath)) {
console.warn('KawAnime [PostInstall] -- Could not find libmpv library file. Please install it and put it in `public/mpv`')
} else {
console.log(`KawAnime [PostInstall] -- Found libmpv at ${libPath}`)
@ -27,3 +26,4 @@ if (IS_LINUX) {
join(__dirname, '..', '..', '..', 'public', 'mpv', libFilename)
)
}
}