优化远程安装程序

This commit is contained in:
GoEdgeLab
2022-07-27 08:35:15 +08:00
parent 36d3b84d2f
commit 8fa0d46f56
2 changed files with 10 additions and 10 deletions

View File

@@ -77,12 +77,12 @@ func (this *NodeInstaller) Install(dir string, params interface{}, installStatus
_, err = this.client.Stat(exePath)
if err == nil {
_, _, _ = this.client.Exec(exePath + " quit")
}
// 删除可执行文件防止冲突
err = this.client.Remove(exePath)
if err != nil && err != os.ErrNotExist {
return errors.New("remove old file failed: " + err.Error())
// 删除可执行文件防止冲突
err = this.client.Remove(exePath)
if err != nil && err != os.ErrNotExist {
return errors.New("remove old file failed: " + err.Error())
}
}
}

View File

@@ -77,12 +77,12 @@ func (this *NSNodeInstaller) Install(dir string, params interface{}, installStat
_, err = this.client.Stat(exePath)
if err == nil {
_, _, _ = this.client.Exec(exePath + " stop")
}
// 删除可执行文件防止冲突
err = this.client.Remove(exePath)
if err != nil && err != os.ErrNotExist {
return errors.New("remove old file failed: " + err.Error())
// 删除可执行文件防止冲突
err = this.client.Remove(exePath)
if err != nil && err != os.ErrNotExist {
return errors.New("remove old file failed: " + err.Error())
}
}
}