From d30abe318a43c0265b7e10ab941e228e1d8221ec Mon Sep 17 00:00:00 2001 From: Alyxia Date: Mon, 31 Jul 2023 19:40:22 +0200 Subject: [PATCH] [middle] Fix data path not creating on Linux --- middle/config.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/middle/config.go b/middle/config.go index ecb609a..7336a9a 100644 --- a/middle/config.go +++ b/middle/config.go @@ -51,21 +51,21 @@ func GetUserData() *UserData { // GetDataPath returns the path to the installer's data path. func GetDataPath() string { + dirs := appdir.New("replugged-installer") + data := dirs.UserData() + // We LOVE platform-specific hacks. // Fixes the running-as-root $HOME issue. if IsLinux() { userData := GetUserData() if userData.Name != "" { usr := strings.TrimSuffix(userData.Name, "\n") - return fmt.Sprintf("/home/%s/.local/share/replugged-installer", usr) + data = fmt.Sprintf("/home/%s/.local/share/replugged-installer", usr) } else { return "" } } - dirs := appdir.New("replugged-installer") - data := dirs.UserData() - if err := os.MkdirAll(data, 0755); err != nil { panic(err) }