fix: 修复git set proxy 命令执行出错的bug
parent
b1ed9f4d31
commit
ee4b63a933
|
@ -24,11 +24,11 @@ const Plugin = function (context) {
|
||||||
|
|
||||||
async setProxy (ip, port) {
|
async setProxy (ip, port) {
|
||||||
const cmds = [
|
const cmds = [
|
||||||
`git config --global http.proxy http://${ip}:${port}`,
|
`git config --global http.proxy http://${ip}:${port} `,
|
||||||
`git config --global https.proxy http://${ip}:${port}`
|
`git config --global https.proxy http://${ip}:${port} `
|
||||||
]
|
]
|
||||||
if (pluginConfig.setting.sslVerify === false) {
|
if (pluginConfig.setting.sslVerify === false) {
|
||||||
cmds.push('git config http.sslVerify "false"')
|
cmds.push('git config --global http.sslVerify false ')
|
||||||
}
|
}
|
||||||
|
|
||||||
const ret = await shell.exec(cmds, { type: 'cmd' })
|
const ret = await shell.exec(cmds, { type: 'cmd' })
|
||||||
|
@ -40,11 +40,11 @@ const Plugin = function (context) {
|
||||||
|
|
||||||
async unsetProxy () {
|
async unsetProxy () {
|
||||||
const cmds = [
|
const cmds = [
|
||||||
'git config --global --unset https.proxy',
|
'git config --global --unset https.proxy ',
|
||||||
'git config --global --unset http.proxy'
|
'git config --global --unset http.proxy '
|
||||||
]
|
]
|
||||||
if (pluginConfig.setting.sslVerify === false) {
|
if (pluginConfig.setting.sslVerify === false) {
|
||||||
cmds.push('git config --unset http.sslVerify ')
|
cmds.push('git config --global http.sslVerify true ')
|
||||||
}
|
}
|
||||||
const ret = await shell.exec(cmds, { type: 'cmd' })
|
const ret = await shell.exec(cmds, { type: 'cmd' })
|
||||||
event.fire('status', { key: 'plugin.git.enabled', value: false })
|
event.fire('status', { key: 'plugin.git.enabled', value: false })
|
||||||
|
|
Loading…
Reference in New Issue