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
@@ -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
