diff --git a/fclauncher/InstanceManager.go b/fclauncher/InstanceManager.go index ae1deb9..98a5e4f 100644 --- a/fclauncher/InstanceManager.go +++ b/fclauncher/InstanceManager.go @@ -507,12 +507,24 @@ func (i *InstanceManager) ImportMrpack(data io.Reader, name string) { if prefix == "overrides" || prefix == "client-overrides" { path := strings.SplitN(entry.Name, "/", 2)[1] if entry.IsDir() { + fmt.Printf("creating directory %s\n", filepath.Join(InstancePath, path)) if _, err := os.Stat(filepath.Join(InstancePath, path)); err != nil { os.MkdirAll(filepath.Join(InstancePath, path), 0755) } } else { zf, _ := entry.Open() defer zf.Close() + fileDir := "" + tokens := strings.Split(path, "/") + for ind, token := range tokens { + if ind != len(tokens)-1 { + fileDir = filepath.Join(fileDir, token) + } + } + fmt.Printf("creating directory %s\n", filepath.Join(InstancePath, fileDir)) + if _, err := os.Stat(filepath.Join(InstancePath, fileDir)); err != nil { + os.MkdirAll(filepath.Join(InstancePath, fileDir), 0755) + } file, _ := os.OpenFile(filepath.Join(InstancePath, path), os.O_CREATE|os.O_RDWR, 0755) defer file.Close() io.Copy(file, zf)