mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
dst to src remove old after convert
This commit is contained in:
@@ -83,7 +83,7 @@ async function charaWrite(img_url, data, target_img, response = undefined, mes =
|
|||||||
const p = process.argv[2]
|
const p = process.argv[2]
|
||||||
const files = fs.readdirSync(p).filter(e => e.endsWith(".webp"))
|
const files = fs.readdirSync(p).filter(e => e.endsWith(".webp"))
|
||||||
|
|
||||||
const dst = "characters"
|
const dst = p
|
||||||
|
|
||||||
try { fs.mkdirSync(dst) } catch {}
|
try { fs.mkdirSync(dst) } catch {}
|
||||||
|
|
||||||
@@ -96,4 +96,5 @@ for(const f of files) {
|
|||||||
await webp.dwebp(source, dest, "-o")
|
await webp.dwebp(source, dest, "-o")
|
||||||
console.log(`Write... ${dest}`)
|
console.log(`Write... ${dest}`)
|
||||||
await charaWrite(dest, data, dest)
|
await charaWrite(dest, data, dest)
|
||||||
|
fs.rmSync(source)
|
||||||
}
|
}
|
Reference in New Issue
Block a user