Files
bot-whatsapp/scripts/move.js
6rak0 8c6023e93b style: ✏️ fixed typos
fixed typos
2022-12-08 14:34:41 -06:00

19 lines
584 B
JavaScript

const fs = require('fs-extra')
const PACKAGES_PATH = `${process.cwd()}/packages`
const NAME_PREFIX = `@bot-whatsapp`
const [, , appDir] = process.argv || []
const copyLibPkg = async (pkgName, to) => {
const FROM = `${PACKAGES_PATH}/${pkgName}`
const TO = `${process.cwd()}/${to}/node_modules/${NAME_PREFIX}/${pkgName}`
await fs.copy(FROM, TO)
}
Promise.all([
copyLibPkg('create-bot-whatsapp', appDir),
copyLibPkg('bot', appDir),
copyLibPkg('database', appDir),
copyLibPkg('provider', appDir),
]).then(() => console.log('Todas las librerías copiadas'))