mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-18 03:29:15 +00:00
26 lines
601 B
JavaScript
26 lines
601 B
JavaScript
const fs = require('fs-extra')
|
|
|
|
/**
|
|
* Copy files
|
|
*/
|
|
const copyFiles = async (from, to) => {
|
|
try {
|
|
await fs.copy(from, to)
|
|
console.log('success!')
|
|
} catch (err) {
|
|
console.error(err)
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Copiar directorio con archivos
|
|
* @param {*} templateName
|
|
*/
|
|
const copyBaseApp = async (templateName = null, rootDir = process.cwd()) => {
|
|
const BASEP_APP_PATH_FROM = `${rootDir}/starters/apps/${templateName}`
|
|
const BASEP_APP_PATH_TO = `${rootDir}/${templateName}`
|
|
await copyFiles(BASEP_APP_PATH_FROM, BASEP_APP_PATH_TO)
|
|
}
|
|
|
|
module.exports = { copyBaseApp }
|