From 74463bb0f1dc606ce8856db350ea88a6cf7840c4 Mon Sep 17 00:00:00 2001 From: Kylart Date: Mon, 13 Apr 2020 21:47:38 +0200 Subject: [PATCH] Fix lib import for linux platforms --- scripts/externals/mpv/libs.js | 38 +++++++++++++++++------------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/scripts/externals/mpv/libs.js b/scripts/externals/mpv/libs.js index fc52144..297bf6b 100644 --- a/scripts/externals/mpv/libs.js +++ b/scripts/externals/mpv/libs.js @@ -3,27 +3,27 @@ const { join } = require('path') const IS_LINUX = !['win32', 'darwin'].includes(process.platform) -const baseDir = ({ - 'darwin': '/usr/local/lib', - 'win32': 'C:\\Windows\\system32' -}[process.platform]) +if (!IS_LINUX) { + const baseDir = ({ + 'darwin': '/usr/local/lib', + 'win32': 'C:\\Windows\\system32' + }[process.platform]) -const libFilename = ({ - 'darwin': 'libmpv.1.dylib', - 'win32': 'mpv-1.dll' -}[process.platform]) + const libFilename = ({ + 'darwin': 'libmpv.1.dylib', + 'win32': 'mpv-1.dll' + }[process.platform]) -const libPath = join(baseDir, 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)) { - 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}`) + 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}`) - copyFileSync( - libPath, - join(__dirname, '..', '..', '..', 'public', 'mpv', libFilename) - ) + copyFileSync( + libPath, + join(__dirname, '..', '..', '..', 'public', 'mpv', libFilename) + ) + } }