From 65b5d6c5a93e61f04db60272ce001a3b6ebcb54b Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Thu, 7 Sep 2017 17:02:26 -0400 Subject: [PATCH] Handle zip files that do not list directories Some zip files do not mark the subdirectories in them as "files" but they still need to be created. Fixes #803 --- cmd/micro/pluginmanager.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/micro/pluginmanager.go b/cmd/micro/pluginmanager.go index 7fe46334..db611fad 100644 --- a/cmd/micro/pluginmanager.go +++ b/cmd/micro/pluginmanager.go @@ -8,6 +8,7 @@ import ( "io/ioutil" "net/http" "os" + "path" "path/filepath" "sort" "strings" @@ -434,6 +435,12 @@ func (pv *PluginVersion) DownloadAndInstall() error { return err } } else { + basepath := path.Dir(targetName) + + if err := os.MkdirAll(basepath, dirPerm); err != nil { + return err + } + content, err := f.Open() if err != nil { return err