mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-08 03:00:26 +08:00
升级API节点前先测试版本
This commit is contained in:
@@ -434,6 +434,13 @@ func (this *APINodeService) UploadAPINodeFile(ctx context.Context, req *pb.Uploa
|
||||
return nil, errors.New("extract file failed: " + err.Error())
|
||||
}
|
||||
|
||||
// 检查文件是否可执行
|
||||
var testCmd = exec.Command(targetFile, "-V")
|
||||
err = testCmd.Run()
|
||||
if err != nil {
|
||||
return nil, errors.New("test file failed: " + err.Error())
|
||||
}
|
||||
|
||||
// 替换文件
|
||||
err = os.Remove(exe)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user