(exec, { certPath })
| 27 | return true |
| 28 | }, |
| 29 | async mac (exec, { certPath }) { |
| 30 | if (!certPath) { |
| 31 | throw new Error('证书路径为空,无法安装根证书。请确认证书文件已生成。') |
| 32 | } |
| 33 | if (!fs.existsSync(certPath)) { |
| 34 | throw new Error(`证书文件不存在: ${certPath}`) |
| 35 | } |
| 36 | const cmds = [`open "${certPath}"`] |
| 37 | await exec(cmds, { type: 'cmd' }) |
| 38 | return true |
| 39 | }, |
| 40 | } |
| 41 | |
| 42 | module.exports = async function (args) { |