远程升级节点时,如果老的文件不存在,则不提示

This commit is contained in:
GoEdgeLab
2022-07-26 20:10:50 +08:00
parent 176df81c8f
commit 36d3b84d2f
2 changed files with 4 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ import (
"errors"
"github.com/TeaOSLab/EdgeAPI/internal/db/models"
"github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs"
"os"
"path/filepath"
"regexp"
)
@@ -80,7 +81,7 @@ func (this *NodeInstaller) Install(dir string, params interface{}, installStatus
// 删除可执行文件防止冲突
err = this.client.Remove(exePath)
if err != nil {
if err != nil && err != os.ErrNotExist {
return errors.New("remove old file failed: " + err.Error())
}
}