deploy.js

This commit is contained in:
洛洛希雅 2024-04-25 08:48:44 +08:00
parent bde10de12c
commit 7273c1da91

View File

@ -108,13 +108,13 @@ async function main() {
await exec(`mv ${target}/dist ${target}/home`) await exec(`mv ${target}/dist ${target}/home`)
//} //}
const nginxTarget = '/home/lolosia/nginx' const nginxTarget = '/usr/share/nginx/html'
console.log('移除旧目录 ...') console.log('移除旧目录 ...')
await sudo(`rm -rf ${nginxTarget}/${nginxContentPath}`) await sudo(`rm -rf ${nginxTarget}/${nginxContentPath}`)
console.log('复制文件 到指定目录 ...') console.log('复制文件 到指定目录 ...')
await sudo(`cp -r -f ${target}/* ${nginxTarget}`) await sudo(`cp -r -f ${target}/* ${nginxTarget}/home`)
await new Promise((r) => { await new Promise((r) => {
dialog.info(`你现在可以关闭终端,去做其他事情了`, `${nginxContentPath}项目部署完成!`, r) dialog.info(`你现在可以关闭终端,去做其他事情了`, `${nginxContentPath}项目部署完成!`, r)
}) })