@@ -33,25 +33,25 @@ func DownloadPlugins(conf *configloader.Config) error {
33
33
pluginMD5FileName := configloader .GetPluginMD5FileName (& tool )
34
34
// plugin does not exist
35
35
if _ , err := os .Stat (filepath .Join (pluginDir , pluginFileName )); err != nil {
36
- if errors .Is (err , os .ErrNotExist ) {
37
- // download .so file
38
- if err := dc .download (pluginDir , pluginFileName , version .Version ); err != nil {
39
- return err
40
- }
41
- log .Successf ("[%s] download succeeded." , pluginFileName )
36
+ if ! errors .Is (err , os .ErrNotExist ) {
37
+ return err
42
38
}
43
- return err
39
+ // download .so file
40
+ if err := dc .download (pluginDir , pluginFileName , version .Version ); err != nil {
41
+ return err
42
+ }
43
+ log .Successf ("[%s] download succeeded." , pluginFileName )
44
44
}
45
45
// .md5 does not exist
46
46
if _ , err := os .Stat (filepath .Join (pluginDir , pluginMD5FileName )); err != nil {
47
- if errors .Is (err , os .ErrNotExist ) {
48
- // download .md5 file
49
- if err := dc .download (pluginDir , pluginMD5FileName , version .Version ); err != nil {
50
- return err
51
- }
52
- log .Successf ("[%s] download succeeded." , pluginMD5FileName )
47
+ if ! errors .Is (err , os .ErrNotExist ) {
48
+ return err
53
49
}
54
- return err
50
+ // download .md5 file
51
+ if err := dc .download (pluginDir , pluginMD5FileName , version .Version ); err != nil {
52
+ return err
53
+ }
54
+ log .Successf ("[%s] download succeeded." , pluginMD5FileName )
55
55
}
56
56
// check if the plugin matches with .md5
57
57
isMD5Match , err := md5 .FileMatchesMD5 (filepath .Join (pluginDir , pluginFileName ), filepath .Join (pluginDir , pluginMD5FileName ))
@@ -101,7 +101,6 @@ func CheckLocalPlugins(conf *configloader.Config) error {
101
101
}
102
102
return err
103
103
}
104
-
105
104
if err := pluginAndMD5Matches (pluginDir , pluginFileName , pluginMD5FileName , tool .Name ); err != nil {
106
105
return err
107
106
}
0 commit comments