chore(cli): added new function

This commit is contained in:
Leifer Mendez
2022-12-01 20:44:12 +01:00
parent 648354500b
commit 05c6fd4528
3 changed files with 37 additions and 19 deletions

17
scripts/move.js Normal file
View File

@@ -0,0 +1,17 @@
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('bot', appDir),
copyLibPkg('database', appDir),
copyLibPkg('provider', appDir),
]).then(() => console.log('Todas las lib copiadas'))