将错误日志保存到文件当中
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,3 +2,4 @@
|
|||||||
/package-lock.json
|
/package-lock.json
|
||||||
/zips/
|
/zips/
|
||||||
/aicode/
|
/aicode/
|
||||||
|
/logs/
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ module.exports = {
|
|||||||
mp: 'dvcp_v2_wxmp'
|
mp: 'dvcp_v2_wxmp'
|
||||||
}[info.type] || {}
|
}[info.type] || {}
|
||||||
let path = `../${buildPath}`,
|
let path = `../${buildPath}`,
|
||||||
{dist} = info
|
{dist} = info
|
||||||
dist = dist || `../zips/${info.name}v${info.version || "1.0.0"}`
|
dist = dist || `../zips/${info.name}v${info.version || "1.0.0"}`
|
||||||
Promise.all([
|
Promise.all([
|
||||||
execute(`./shell/update.sh ${info.name} ${path}`),
|
execute(`./shell/update.sh ${info.name} ${path}`),
|
||||||
@@ -26,13 +26,13 @@ module.exports = {
|
|||||||
response.send({code: 0})
|
response.send({code: 0})
|
||||||
}, 1000))
|
}, 1000))
|
||||||
execute(`cd ${path}&&npm run apps&&node bin/pages.js ${id}&&npm run build`)
|
execute(`cd ${path}&&npm run apps&&node bin/pages.js ${id}&&npm run build`)
|
||||||
.then(() => fse.emptyDir(dist))
|
.then(() => fse.emptyDir(dist))
|
||||||
.then(() => execute(`./shell/move.sh ${info.type} ${path} ${dist}`))
|
.then(() => execute(`./shell/move.sh ${info.type} ${path} ${dist}`))
|
||||||
.then(() => {
|
.then(() => {
|
||||||
return db.query(`update node_custom_config set download='${dayjs().format("YYYY-MM-DD HH:mm:ss")}',error='' where ${uniCon}`)
|
return db.query(`update node_custom_config set download='${dayjs().format("YYYY-MM-DD HH:mm:ss")}',error='' where ${uniCon}`)
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
return db.query(`update node_custom_config set error='${err}',zipTime=null where ${uniCon}`)
|
return fse.outputFile(`./logs/errors/${dayjs().format("YYYY-MM-DD")}.log`, err)
|
||||||
})
|
})
|
||||||
} else return response.send({code: 1, err: "无法找到定制项目信息"})
|
} else return response.send({code: 1, err: "无法找到定制项目信息"})
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
|
|||||||
Reference in New Issue
Block a user