mirror of https://github.com/Kylart/KawAnime.git
Added error handling for move libs
This commit is contained in:
parent
c8644f5dbf
commit
9670a081c0
|
@ -5,12 +5,16 @@ const { join, basename } = require('path')
|
||||||
const PUBLIC_DIR = join(__dirname, '..', 'public')
|
const PUBLIC_DIR = join(__dirname, '..', 'public')
|
||||||
|
|
||||||
function moveToPublic (filepath) {
|
function moveToPublic (filepath) {
|
||||||
|
try {
|
||||||
console.log(`[KawAnime] Copying ${filepath} to public directory.`)
|
console.log(`[KawAnime] Copying ${filepath} to public directory.`)
|
||||||
|
|
||||||
copyFileSync(
|
copyFileSync(
|
||||||
filepath,
|
filepath,
|
||||||
join(PUBLIC_DIR, basename(filepath))
|
join(PUBLIC_DIR, basename(filepath))
|
||||||
)
|
)
|
||||||
|
} catch (e) {
|
||||||
|
console.warn(`[KawAnime] Could not find ${filepath}`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function linux () {
|
function linux () {
|
||||||
|
|
Loading…
Reference in New Issue