File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ func spDownloadTool(name string, url string) {
98
98
h .broadcastSys <- mapB
99
99
return
100
100
}
101
- err = Unzip (fileName , tempToolsPath )
101
+ err = UnzipWrapper (fileName , tempToolsPath )
102
102
if err != nil {
103
103
log .Error ("Could not unzip flashing tools!" )
104
104
mapD := map [string ]string {"DownloadStatus" : "Error" , "Msg" : err .Error ()}
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ import (
41
41
"github.com/inconshreveable/go-update"
42
42
"github.com/kardianos/osext"
43
43
"github.com/kr/binarydist"
44
+ "github.com/pivotal-golang/archiver/extractor"
44
45
patch "github.com/sanderhahn/gozip/patchzip"
45
46
"io"
46
47
"io/ioutil"
@@ -54,6 +55,11 @@ import (
54
55
"time"
55
56
)
56
57
58
+ func UnzipWrapper (src , dest string ) error {
59
+ e := extractor .NewDetectable ()
60
+ return e .Extract (src , dest )
61
+ }
62
+
57
63
func IsZip (path string ) bool {
58
64
r , err := zip .OpenReader (path )
59
65
if err == nil {
You can’t perform that action at this time.
0 commit comments