mirror of
https://github.com/packwiz/packwiz.git
synced 2025-11-19 01:24:32 +01:00
Make import look in more places for packs
Now supports Curse/Twitch instance names and folders containing minecraftinstance.json or manifest.json
This commit is contained in:
25
curseforge/cursedir_windows.go
Normal file
25
curseforge/cursedir_windows.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package curseforge
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"golang.org/x/sys/windows"
|
||||
)
|
||||
|
||||
func getCurseDir() (string, error) {
|
||||
path, err := windows.KnownFolderPath(windows.FOLDERID_Documents, 0)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
curseDir := filepath.Join(path, "Curse")
|
||||
if _, err := os.Stat(curseDir); err == nil {
|
||||
return curseDir, nil
|
||||
}
|
||||
curseDir = filepath.Join(path, "Twitch")
|
||||
if _, err := os.Stat(curseDir); err == nil {
|
||||
return curseDir, nil
|
||||
}
|
||||
return "", errors.New("Curse installation directory cannot be found")
|
||||
}
|
||||
Reference in New Issue
Block a user