Files
dvcp_v2_wechat_app/bin/lib.js
2022-05-12 10:58:39 +08:00

17 lines
480 B
JavaScript

const {findApp, chalkTag, copyFiles} = require("./tools");
const start = () => {
chalkTag.info("扫描主库目录,并搬运打包应用至lib文件夹下")
let apps = []
findApp('src/mods', file => apps.push(file))
.then(() => Promise.all([...new Set(apps)].map(e => {
let name = e.replace(/.+[\\\/]([^\\\/]+)$/, '$1')
if (/^App/.test(name)) {
return copyFiles(`lib/${name}`, e)
}
})))
.then(() => {
chalkTag.done("打包完成")
})
}
start()