mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-18 03:29:15 +00:00
17 lines
466 B
JavaScript
17 lines
466 B
JavaScript
const rimraf = require('rimraf')
|
|
const { yellow } = require('kleur')
|
|
const { join } = require('path')
|
|
|
|
const PATH_WW = [join(process.cwd(), '.wwebjs_auth'), join(process.cwd(), 'session.json')]
|
|
|
|
const cleanSession = () => {
|
|
const queue = []
|
|
for (const PATH of PATH_WW) {
|
|
console.log(yellow(`😬 Eliminando: ${PATH}`))
|
|
queue.push(rimraf(PATH, () => Promise.resolve()))
|
|
}
|
|
return Promise.all(queue)
|
|
}
|
|
|
|
module.exports = { cleanSession }
|