Added error handling for move libs

This commit is contained in:
Kylart 2020-03-29 18:59:17 +02:00
parent c8644f5dbf
commit 9670a081c0
1 changed files with 9 additions and 5 deletions

View File

@ -5,12 +5,16 @@ const { join, basename } = require('path')
const PUBLIC_DIR = join(__dirname, '..', 'public')
function moveToPublic (filepath) {
try {
console.log(`[KawAnime] Copying ${filepath} to public directory.`)
copyFileSync(
filepath,
join(PUBLIC_DIR, basename(filepath))
)
} catch (e) {
console.warn(`[KawAnime] Could not find ${filepath}`)
}
}
function linux () {