增加node多版本兼容打包

This commit is contained in:
aixianling
2022-06-23 09:35:44 +08:00
parent 8452180cfb
commit 35019b0d0f

View File

@@ -14,10 +14,16 @@ module.exports = {
fse.emptydir(info.target, () => {
response.send({code: 0})
})
}).then(()=>{
}).then(() => {
if (!!info.type) {
let {type, zipPath, target, name} = info
return execute(`/root/node-service/update.sh ${name} ${zipPath}`).then(() => execute(`/root/node-service/build.sh ${type} ${zipPath} ${target}`))
let {type, zipPath, target, name, nodeVersion} = info,
updateCMD = `/root/node-service/update.sh ${name} ${zipPath}`,
buildCMD = `/root/node-service/build.sh ${type} ${zipPath} ${target}`
if (nodeVersion) {
updateCMD += `&n ${nodeVersion}`
buildCMD += `&n 16.14.0`
}
return execute(updateCMD).then(() => execute(buildCMD))
} else {
return execute(`${info.updateShell}`).then(() => execute(`${info.libShell}`))
}