feat 同步前端代码

feat 同步PC代码
feat 增加1.9DB
feat 同步逻辑
This commit is contained in:
damonyuan
2024-08-29 00:24:01 +08:00
parent 1e233d1207
commit 7badc8ae0f
352 changed files with 42846 additions and 37408 deletions

36
admin/scripts/release.mjs Normal file
View File

@@ -0,0 +1,36 @@
import fsExtra from 'fs-extra'
import path from 'path'
const { existsSync, remove, copy } = fsExtra
const cwd = process.cwd()
//打包发布路径,谨慎改动
const releaseRelativePath = '../server/public/admin'
const distPath = path.resolve(cwd, 'dist')
const releasePath = path.resolve(cwd, releaseRelativePath)
async function build() {
if (existsSync(releasePath)) {
await remove(releasePath)
}
console.log(`文件正在复制 ==> ${releaseRelativePath}`)
try {
await copyFile(distPath, releasePath)
} catch (error) {
console.log(`\n ${error}`)
}
console.log(`文件已复制 ==> ${releaseRelativePath}`)
}
function copyFile(sourceDir, targetDir) {
return new Promise((resolve, reject) => {
copy(sourceDir, targetDir, (err) => {
if (err) {
reject(err)
} else {
resolve()
}
})
})
}
build()