dst to src remove old after convert

This commit is contained in:
Alexey Dashko
2023-04-06 15:55:59 +03:00
parent b0e72bd969
commit d9a8598632

View File

@@ -83,7 +83,7 @@ async function charaWrite(img_url, data, target_img, response = undefined, mes =
const p = process.argv[2]
const files = fs.readdirSync(p).filter(e => e.endsWith(".webp"))
const dst = "characters"
const dst = p
try { fs.mkdirSync(dst) } catch {}
@@ -96,4 +96,5 @@ for(const f of files) {
await webp.dwebp(source, dest, "-o")
console.log(`Write... ${dest}`)
await charaWrite(dest, data, dest)
fs.rmSync(source)
}