mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-07 02:20:24 +08:00
远程升级节点时,如果老的文件不存在,则不提示
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"github.com/TeaOSLab/EdgeAPI/internal/db/models"
|
"github.com/TeaOSLab/EdgeAPI/internal/db/models"
|
||||||
"github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs"
|
"github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs"
|
||||||
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
)
|
)
|
||||||
@@ -80,7 +81,7 @@ func (this *NodeInstaller) Install(dir string, params interface{}, installStatus
|
|||||||
|
|
||||||
// 删除可执行文件防止冲突
|
// 删除可执行文件防止冲突
|
||||||
err = this.client.Remove(exePath)
|
err = this.client.Remove(exePath)
|
||||||
if err != nil {
|
if err != nil && err != os.ErrNotExist {
|
||||||
return errors.New("remove old file failed: " + err.Error())
|
return errors.New("remove old file failed: " + err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"github.com/TeaOSLab/EdgeAPI/internal/db/models"
|
"github.com/TeaOSLab/EdgeAPI/internal/db/models"
|
||||||
"github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs"
|
"github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs"
|
||||||
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
)
|
)
|
||||||
@@ -80,7 +81,7 @@ func (this *NSNodeInstaller) Install(dir string, params interface{}, installStat
|
|||||||
|
|
||||||
// 删除可执行文件防止冲突
|
// 删除可执行文件防止冲突
|
||||||
err = this.client.Remove(exePath)
|
err = this.client.Remove(exePath)
|
||||||
if err != nil {
|
if err != nil && err != os.ErrNotExist {
|
||||||
return errors.New("remove old file failed: " + err.Error())
|
return errors.New("remove old file failed: " + err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user